package org.nmdp.hmlfhirconverter.mapping.fhir;

/**
 * Created by Andrew S. Brown, Ph.D., <abrown3@nmdp.org>, on 4/13/17.
 * <p>
 * service-hmlFhirConverter
 * Copyright (c) 2012-2017 National Marrow Donor Program (NMDP)
 * <p>
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 * <p>
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 * License for more details.
 * <p>
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library;  if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
 * <p>
 * > http://www.fsf.org/licensing/licenses/lgpl.html
 * > http://www.opensource.org/licenses/lgpl-license.php
 */

public class ObservationMap {
}

@@ -42,16 +42,17 @@
 .fhir;%0A%0A
+%0A
 /**%0A * C
@@ -1093,36 +1093,795 @@
 */%0A%0A
-public class ObservationMap %7B
+import io.swagger.model.Typing;%0Aimport org.modelmapper.Converter;%0A%0Aimport io.swagger.model.Hml;%0A%0Aimport org.modelmapper.spi.MappingContext;%0Aimport org.nmdp.hmlfhirconverter.domain.fhir.Code;%0Aimport org.nmdp.hmlfhirconverter.domain.fhir.Observation;%0A%0Apublic class ObservationMap implements Converter%3CHml, Observation%3E%7B%0A%0A    @Override%0A    public Observation convert(MappingContext%3CHml, Observation%3E context) %7B%0A        if (context.getSource() == null) %7B%0A            return null;%0A        %7D%0A%0A        Hml hml = context.getSource();%0A        Typing typing = hml.getSamples().get(0).getTyping();%0A        Observation observation = new Observation();%0A        Code code = new Code();%0A%0A        code.setName(typing.getGeneFamily());%0A        observation.setCode(code);%0A%0A        return observation;%0A    %7D
 %0A%7D%0A

Add observation mapping