protected SectionComponent processAdverseReactionsSection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element concern = cda.getChild(entry, "act"); if (cda.hasTemplateId(concern, "2.16.840.1.113883.10.20.22.4.30")) { processAllergyProblemAct(list, concern); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(concern)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Allergies, Adverse Reactions, Alerts", makeUUIDReference()))); return s; }
protected SectionComponent processVitalSignsSection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element organizer = cda.getlastChild(entry); if (cda.hasTemplateId(organizer, "2.16.840.1.113883.10.20.22.4.26")) { processVitalSignsOrganizer(list, organizer); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(organizer)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Vital Signs", makeUUIDReference()))); return s; }
protected SectionComponent processProceduresSection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element procedure = cda.getlastChild(entry); if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.14")) { processProcedure(list, procedure, ProcedureType.Procedure); } else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.13")) { processProcedure(list, procedure, ProcedureType.Observation); } else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.12")) { processProcedure(list, procedure, ProcedureType.Act); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(procedure)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Procedures", makeUUIDReference()))); return s; }
protected SectionComponent processSocialHistorySection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element observation = cda.getlastChild(entry); if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.22.4.38")) { processSocialObservation(list, observation, SocialHistoryType.SocialHistory); } else if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.15.3.8")) { processSocialObservation(list, observation, SocialHistoryType.Pregnancy); } else if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.22.4.78")) { processSocialObservation(list, observation, SocialHistoryType.SmokingStatus); } else if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.22.4.85")) { processSocialObservation(list, observation, SocialHistoryType.TobaccoUse); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(observation)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Procedures", makeUUIDReference()))); return s; }
/** * @return {@link #patients} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) */ public ListResource getPatientsTarget() { if (this.patientsTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.patients"); else if (Configuration.doAutoCreate()) this.patientsTarget = new ListResource(); // aa return this.patientsTarget; }
/** * @return {@link #patients} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) */ public ListResource getPatientsTarget() { if (this.patientsTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create StratifierGroupPopulationComponent.patients"); else if (Configuration.doAutoCreate()) this.patientsTarget = new ListResource(); // aa return this.patientsTarget; }
public org.hl7.fhir.dstu3.model.ListResource convertList(org.hl7.fhir.instance.model.List_ src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ListResource tgt = new org.hl7.fhir.dstu3.model.ListResource(); copyDomainResource(src, tgt); for (org.hl7.fhir.instance.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); tgt.setTitle(src.getTitle()); tgt.setCode(convertCodeableConcept(src.getCode())); tgt.setSubject(convertReference(src.getSubject())); tgt.setSource(convertReference(src.getSource())); tgt.setEncounter(convertReference(src.getEncounter())); tgt.setStatus(convertListStatus(src.getStatus())); if (src.hasDate()) tgt.setDate(src.getDate()); tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); tgt.setMode(convertListMode(src.getMode())); if (src.hasNote()) tgt.addNote(new org.hl7.fhir.dstu3.model.Annotation().setText(src.getNote())); for (org.hl7.fhir.instance.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); return tgt; }
private Resource responseResource(Resource request) { if (request instanceof DocumentManifest) { return new DocumentManifest().setId(UUID.randomUUID().toString()); } else if (request instanceof DocumentReference) { return new DocumentReference().setId(UUID.randomUUID().toString()); } else if (request instanceof ListResource) { return new ListResource().setId(UUID.randomUUID().toString()); } else if (request instanceof Binary) { return new Binary().setId(UUID.randomUUID().toString()); } else { throw new IllegalArgumentException(request + " is not allowed here"); } }
public ListResource copy() { ListResource dst = new ListResource(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); }; dst.status = status == null ? null : status.copy(); dst.mode = mode == null ? null : mode.copy(); dst.title = title == null ? null : title.copy(); dst.code = code == null ? null : code.copy(); dst.subject = subject == null ? null : subject.copy(); dst.encounter = encounter == null ? null : encounter.copy(); dst.date = date == null ? null : date.copy(); dst.source = source == null ? null : source.copy(); dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); if (note != null) { dst.note = new ArrayList<Annotation>(); for (Annotation i : note) dst.note.add(i.copy()); }; if (entry != null) { dst.entry = new ArrayList<ListEntryComponent>(); for (ListEntryComponent i : entry) dst.entry.add(i.copy()); }; dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); return dst; }
return new Procedure(); if ("List".equals(name)) return new ListResource(); if ("ConceptMap".equals(name)) return new ConceptMap();
protected SectionComponent processVitalSignsSection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element organizer = cda.getlastChild(entry); if (cda.hasTemplateId(organizer, "2.16.840.1.113883.10.20.22.4.26")) { processVitalSignsOrganizer(list, organizer); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(organizer)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Vital Signs", makeUUIDReference()))); return s; }
protected SectionComponent processAdverseReactionsSection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element concern = cda.getChild(entry, "act"); if (cda.hasTemplateId(concern, "2.16.840.1.113883.10.20.22.4.30")) { processAllergyProblemAct(list, concern); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(concern)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Allergies, Adverse Reactions, Alerts", makeUUIDReference()))); return s; }
protected SectionComponent processProceduresSection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element procedure = cda.getlastChild(entry); if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.14")) { processProcedure(list, procedure, ProcedureType.Procedure); } else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.13")) { processProcedure(list, procedure, ProcedureType.Observation); } else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.12")) { processProcedure(list, procedure, ProcedureType.Act); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(procedure)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Procedures", makeUUIDReference()))); return s; }
protected SectionComponent processSocialHistorySection(Element section) throws Exception { ListResource list = new ListResource(); for (Element entry : cda.getChildren(section, "entry")) { Element observation = cda.getlastChild(entry); if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.22.4.38")) { processSocialObservation(list, observation, SocialHistoryType.SocialHistory); } else if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.15.3.8")) { processSocialObservation(list, observation, SocialHistoryType.Pregnancy); } else if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.22.4.78")) { processSocialObservation(list, observation, SocialHistoryType.SmokingStatus); } else if (cda.hasTemplateId(observation, "2.16.840.1.113883.10.20.22.4.85")) { processSocialObservation(list, observation, SocialHistoryType.TobaccoUse); } else throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(observation)); } // todo: text SectionComponent s = new Composition.SectionComponent(); s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code"))); // todo: check subject s.addEntry(Factory.makeReference(addReference(list, "Procedures", makeUUIDReference()))); return s; }
public org.hl7.fhir.dstu3.model.ListResource convertList(org.hl7.fhir.instance.model.List_ src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ListResource tgt = new org.hl7.fhir.dstu3.model.ListResource(); copyDomainResource(src, tgt); for (org.hl7.fhir.instance.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); tgt.setTitle(src.getTitle()); tgt.setCode(convertCodeableConcept(src.getCode())); tgt.setSubject(convertReference(src.getSubject())); tgt.setSource(convertReference(src.getSource())); tgt.setEncounter(convertReference(src.getEncounter())); tgt.setStatus(convertListStatus(src.getStatus())); if (src.hasDate()) tgt.setDate(src.getDate()); tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy())); tgt.setMode(convertListMode(src.getMode())); if (src.hasNote()) tgt.addNote(new org.hl7.fhir.dstu3.model.Annotation().setText(src.getNote())); for (org.hl7.fhir.instance.model.List_.ListEntryComponent t : src.getEntry()) tgt.addEntry(convertListEntry(t)); return tgt; }
case 1830861979: return new Library(); case 1841735333: return new Linkage(); case 2368702: return new ListResource(); case 1965687765: return new Location(); case -1691992770: return new Measure();