fixed convertors calling Enumeration with deprecated constructor

This commit is contained in:
patrick-werner 2020-03-07 14:26:10 +01:00
parent b15d72a755
commit 63e97e6fa9
5 changed files with 10 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.Dosage;
import org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent;
import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory;
public class MedicationDispense10_50 {
@ -127,7 +128,7 @@ public class MedicationDispense10_50 {
public static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> convertMedicationDispenseStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus> src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory());
VersionConvertor_10_50.copyElement(src, tgt);
switch(src.getValue()) {
case COMPLETED:

View File

@ -3,6 +3,7 @@ package org.hl7.fhir.convertors.conv30_50;
import org.hl7.fhir.convertors.VersionConvertor_30_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory;
public class MedicationAdministration30_50 {
@ -139,7 +140,7 @@ public class MedicationAdministration30_50 {
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes> convertMedicationAdministrationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus> src) {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationAdministrationStatusCodesEnumFactory());
VersionConvertor_30_50.copyElement(src, tgt);
tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.fromCode(src.getValueAsString()));
return tgt;

View File

@ -25,6 +25,7 @@ import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes;
import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory;
/*
Copyright (c) 2011+, HL7, Inc.
@ -141,7 +142,7 @@ public class MedicationAdministration40_50 extends VersionConvertor_40_50 {
private static Enumeration<MedicationAdministrationStatusCodes> convertMedicationAdministrationStatus(CodeType src) {
if (src == null)
return null;
Enumeration<MedicationAdministrationStatusCodes> tgt = new Enumeration<MedicationAdministrationStatusCodes>();
Enumeration<MedicationAdministrationStatusCodes> tgt = new Enumeration<>(new MedicationAdministrationStatusCodesEnumFactory());
copyElement(src, tgt);
tgt.setValue(MedicationAdministrationStatusCodes.fromCode(src.getCode()));
return tgt;

View File

@ -23,6 +23,7 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes;
import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory;
/*
Copyright (c) 2011+, HL7, Inc.
@ -162,7 +163,7 @@ public class MedicationDispense40_50 extends VersionConvertor_40_50 {
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> convertMedicationStatus(org.hl7.fhir.r4.model.CodeType src) {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory());
copyElement(src, tgt);
if (src.hasCode())
tgt.setValue(MedicationDispenseStatusCodes.fromCode(src.getCode()));

View File

@ -24,6 +24,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes;
import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory;
/*
Copyright (c) 2011+, HL7, Inc.
@ -148,7 +149,7 @@ public class MedicationKnowledge40_50 extends VersionConvertor_40_50 {
private static Enumeration<MedicationKnowledgeStatusCodes> convertMedicationKnowledgeStatus(CodeType src) {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationKnowledgeStatusCodesEnumFactory());
copyElement(src, tgt);
tgt.setValue(MedicationKnowledgeStatusCodes.fromCode(src.getCode()));
return tgt;