private ValueSet resolveBindingReference(DomainResource ctxt, Type reference, String uri) { if (reference instanceof UriType) { long t = System.nanoTime(); ValueSet fr = context.fetchResource(ValueSet.class, ((UriType) reference).getValue().toString()); txTime = txTime + (System.nanoTime() - t); return fr; } else if (reference instanceof Reference) { String s = ((Reference) reference).getReference(); if (s.startsWith("#")) { for (Resource c : ctxt.getContained()) { if (c.getId().equals(s.substring(1)) && (c instanceof ValueSet)) return (ValueSet) c; } return null; } else { long t = System.nanoTime(); String ref = ((Reference) reference).getReference(); if (!Utilities.isAbsoluteUrl(ref)) ref = resolve(uri, ref); ValueSet fr = context.fetchResource(ValueSet.class, ref); txTime = txTime + (System.nanoTime() - t); return fr; } } else return null; }
protected String processDevice(Element participantRole, DomainResource r) throws Exception { Device d = new Device(); for (Element id : cda.getChildren(participantRole, "id")) { // todo: check for UDIs, how? d.getIdentifier().add(convert.makeIdentifierFromII(id)); } Element device = cda.getChild(participantRole, "playingDevice"); // todo: if (cda.getChild(device, "code") != null) d.setType(convert.makeCodeableConceptFromCD(cda.getChild(device, "code"))); // CCDA has an id - this is manufacturer? We just call it the name, but what to do about this? Element org = cda.getChild(participantRole, "scopingEntity"); d.setManufacturer(convert.makeURIfromII(cda.getChild(org, "id"))); String id = nextRef(); d.setId(id); r.getContained().add(d); return "#"+id; }
protected String processSDLocation(Element participantRole, DomainResource r) throws Exception { Location l = new Location(); l.setType(convert.makeCodeableConceptFromCD(cda.getChild(participantRole, "code"))); for (Element id : cda.getChildren(participantRole, "id")) { if (l.getIdentifier() == null) l.getIdentifier().add(convert.makeIdentifierFromII(id)); } for (Element addr : cda.getChildren(participantRole, "addr")) { if (l.getAddress() == null) l.setAddress(convert.makeAddressFromAD(addr)); } for (Element telecom : cda.getChildren(participantRole, "telecom")) { l.getTelecom().add(convert.makeContactFromTEL(telecom)); } Element place = cda.getChild(participantRole, "playingDevice"); if (cda.getChild(place, "name") != null) l.setName(cda.getChild(place, "name").getTextContent()); String id = nextRef(); l.setId(id); r.getContained().add(l); return "#"+id; }
public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.instance.model.DomainResource tgt) throws FHIRException { copyResource(src, tgt); tgt.setText(convertNarrative(src.getText())); for (org.hl7.fhir.dstu3.model.Resource t : src.getContained()) tgt.addContained(convertResource(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getExtension()) tgt.addExtension(convertExtension(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) tgt.addModifierExtension(convertExtension(t)); }
private static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException { copyResource(src, tgt); if (src.hasText()) tgt.setText(convertNarrative(src.getText())); for (org.hl7.fhir.dstu3.model.Resource t : src.getContained()) tgt.addContained(convertResource(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getExtension()) tgt.addExtension(convertExtension(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) tgt.addModifierExtension(convertExtension(t)); } public static org.hl7.fhir.dstu3.model.Parameters convertParameters(org.hl7.fhir.dstu2016may.model.Parameters src) throws FHIRException {
r.getContained().add(p); ref = Factory.makeReference("#"+n); } else {
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("text")) { this.text = castToNarrative(value); // Narrative } else if (name.equals("contained")) { this.getContained().add(castToResource(value)); } else if (name.equals("extension")) { this.getExtension().add(castToExtension(value)); } else if (name.equals("modifierExtension")) { this.getModifierExtension().add(castToExtension(value)); } else return super.setProperty(name, value); return value; }
private ValueSet resolveBindingReference(DomainResource ctxt, Type reference, String uri) { if (reference instanceof UriType) { long t = System.nanoTime(); ValueSet fr = context.fetchResource(ValueSet.class, ((UriType) reference).getValue().toString()); txTime = txTime + (System.nanoTime() - t); return fr; } else if (reference instanceof Reference) { String s = ((Reference) reference).getReference(); if (s.startsWith("#")) { for (Resource c : ctxt.getContained()) { if (c.getId().equals(s.substring(1)) && (c instanceof ValueSet)) return (ValueSet) c; } return null; } else { long t = System.nanoTime(); String ref = ((Reference) reference).getReference(); if (!Utilities.isAbsoluteUrl(ref)) ref = resolve(uri, ref); ValueSet fr = context.fetchResource(ValueSet.class, ref); txTime = txTime + (System.nanoTime() - t); return fr; } } else return null; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3556653: // text this.text = castToNarrative(value); // Narrative return value; case -410956685: // contained this.getContained().add(castToResource(value)); // Resource return value; case -612557761: // extension this.getExtension().add(castToExtension(value)); // Extension return value; case -298878168: // modifierExtension this.getModifierExtension().add(castToExtension(value)); // Extension return value; default: return super.setProperty(hash, name, value); } }
protected String processDevice(Element participantRole, DomainResource r) throws Exception { Device d = new Device(); for (Element id : cda.getChildren(participantRole, "id")) { // todo: check for UDIs, how? d.getIdentifier().add(convert.makeIdentifierFromII(id)); } Element device = cda.getChild(participantRole, "playingDevice"); // todo: if (cda.getChild(device, "code") != null) d.setType(convert.makeCodeableConceptFromCD(cda.getChild(device, "code"))); // CCDA has an id - this is manufacturer? We just call it the name, but what to do about this? Element org = cda.getChild(participantRole, "scopingEntity"); d.setManufacturer(convert.makeURIfromII(cda.getChild(org, "id"))); String id = nextRef(); d.setId(id); r.getContained().add(d); return "#"+id; }
protected String processSDLocation(Element participantRole, DomainResource r) throws Exception { Location l = new Location(); l.setType(convert.makeCodeableConceptFromCD(cda.getChild(participantRole, "code"))); for (Element id : cda.getChildren(participantRole, "id")) { if (l.getIdentifier() == null) l.getIdentifier().add(convert.makeIdentifierFromII(id)); } for (Element addr : cda.getChildren(participantRole, "addr")) { if (l.getAddress() == null) l.setAddress(convert.makeAddressFromAD(addr)); } for (Element telecom : cda.getChildren(participantRole, "telecom")) { l.getTelecom().add(convert.makeContactFromTEL(telecom)); } Element place = cda.getChild(participantRole, "playingDevice"); if (cda.getChild(place, "name") != null) l.setName(cda.getChild(place, "name").getTextContent()); String id = nextRef(); l.setId(id); r.getContained().add(l); return "#"+id; }
for (Resource nextContained : ((DomainResource) next).getContained()) { if (isNotBlank(nextContained.getId())) { containedIds.add(nextContained.getId());
public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.instance.model.DomainResource tgt) throws FHIRException { copyResource(src, tgt); tgt.setText(convertNarrative(src.getText())); for (org.hl7.fhir.dstu3.model.Resource t : src.getContained()) tgt.addContained(convertResource(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getExtension()) tgt.addExtension(convertExtension(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) tgt.addModifierExtension(convertExtension(t)); }
Set<String> containedIds = new HashSet<String>(); if (next instanceof DomainResource) { for (Resource nextContained : ((DomainResource) next).getContained()) { if (nextContained.getIdElement().isEmpty() == false) { containedIds.add(nextContained.getIdElement().getValue());
private static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException { copyResource(src, tgt); if (src.hasText()) tgt.setText(convertNarrative(src.getText())); for (org.hl7.fhir.dstu3.model.Resource t : src.getContained()) tgt.addContained(convertResource(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getExtension()) tgt.addExtension(convertExtension(t)); for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) tgt.addModifierExtension(convertExtension(t)); } public static org.hl7.fhir.dstu3.model.Parameters convertParameters(org.hl7.fhir.dstu2016may.model.Parameters src) throws FHIRException {
r.getContained().add(p); ref = Factory.makeReference("#"+n); } else {