use ElementModel for FML in create
This commit is contained in:
parent
58bee0754a
commit
b86f5a5ac8
|
@ -250,9 +250,9 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
||||||
|
|
||||||
public class TransformSupportServices implements ITransformerServices {
|
public class TransformSupportServices implements ITransformerServices {
|
||||||
|
|
||||||
private List<Resource> outputs;
|
private List<Base> outputs;
|
||||||
|
|
||||||
public TransformSupportServices(List<Resource> outputs) {
|
public TransformSupportServices(List<Base> outputs) {
|
||||||
this.outputs = outputs;
|
this.outputs = outputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,19 +266,13 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
||||||
@Override
|
@Override
|
||||||
public Base createType(Object appInfo, String name) throws FHIRException {
|
public Base createType(Object appInfo, String name) throws FHIRException {
|
||||||
StructureDefinition sd = context.fetchResource(StructureDefinition.class, name);
|
StructureDefinition sd = context.fetchResource(StructureDefinition.class, name);
|
||||||
if (sd != null && sd.getKind() == StructureDefinitionKind.LOGICAL) {
|
|
||||||
return Manager.build(context, sd);
|
return Manager.build(context, sd);
|
||||||
} else {
|
|
||||||
if (name.startsWith("http://hl7.org/fhir/StructureDefinition/"))
|
|
||||||
name = name.substring("http://hl7.org/fhir/StructureDefinition/".length());
|
|
||||||
return ResourceFactory.createResourceOrType(name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Base createResource(Object appInfo, Base res, boolean atRootofTransform) {
|
public Base createResource(Object appInfo, Base res, boolean atRootofTransform) {
|
||||||
if (atRootofTransform)
|
if (atRootofTransform)
|
||||||
outputs.add((Resource) res);
|
outputs.add(res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1216,7 +1210,7 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.hl7.fhir.r5.elementmodel.Element transform(byte[] source, FhirFormat cntType, String mapUri) throws Exception {
|
public org.hl7.fhir.r5.elementmodel.Element transform(byte[] source, FhirFormat cntType, String mapUri) throws Exception {
|
||||||
List<Resource> outputs = new ArrayList<Resource>();
|
List<Base> outputs = new ArrayList<Base>();
|
||||||
|
|
||||||
StructureMapUtilities scu = new StructureMapUtilities(context, new TransformSupportServices(outputs));
|
StructureMapUtilities scu = new StructureMapUtilities(context, new TransformSupportServices(outputs));
|
||||||
org.hl7.fhir.r5.elementmodel.Element src = Manager.parse(context, new ByteArrayInputStream(source), cntType);
|
org.hl7.fhir.r5.elementmodel.Element src = Manager.parse(context, new ByteArrayInputStream(source), cntType);
|
||||||
|
|
Loading…
Reference in New Issue