public Type makeCodeableConceptFromNullFlavor(String nf) throws Exception { // Some nullFlavors have explicit values in value sets. This can only be called where there aren't. if (nf == null || "".equals(nf)) return null; if ("NI".equals(nf)) return null; // there's no code for this if ("NA".equals(nf)) return Factory.newCodeableConcept("unsupported", "http://hl7.org/fhir/data-absent-reason", "Unsupported"); // todo: is this reasonable? Why else would you use N/A? if ("UNK".equals(nf)) return Factory.newCodeableConcept("unknown", "http://hl7.org/fhir/data-absent-reason", "Unknown"); if ("ASKU".equals(nf)) return Factory.newCodeableConcept("asked", "http://hl7.org/fhir/data-absent-reason", "Asked/Unknown"); if ("NAV".equals(nf)) return Factory.newCodeableConcept("temp", "http://hl7.org/fhir/data-absent-reason", "Temporarily Unavailable"); if ("NASK".equals(nf)) return Factory.newCodeableConcept("notasked", "http://hl7.org/fhir/data-absent-reason", "Not Asked"); if ("MSK".equals(nf)) return Factory.newCodeableConcept("masked", "http://hl7.org/fhir/data-absent-reason", "Masked"); if ("OTH".equals(nf)) return null; // well, what should be done? return null; // well, what should be done? }
cda.checkTemplateId(so, "2.16.840.1.113883.10.20.15.3.8"); obs.setCode(Factory.newCodeableConcept("11449-6", "http://loinc.org", "Pregnancy Status")); break; case SmokingStatus: cda.checkTemplateId(so, "2.16.840.1.113883.10.20.22.4.78"); obs.setCode(Factory.newCodeableConcept("72166-2", "http://loinc.org", "Tobacco Smoking Status")); break; case TobaccoUse: cda.checkTemplateId(so, "2.16.840.1.113883.10.20.22.4.12"); obs.setCode(Factory.newCodeableConcept("11367-0", "http://loinc.org", "History of Tobacco Use")); obs.setValue(Factory.newCodeableConcept("60001007", "http://snomed.info/sct", "Not pregnant")); } else { or.setType(ObservationRelationshipType.HASMEMBER); or.setTarget(Factory.makeReference("#"+id)); co.setCode(Factory.newCodeableConcept("11778-8", "http://loinc.org", "Delivery date Estimated")); co.setValue(convert.makeDateTimeFromTS(cda.getChild(dd, "value"))); // not legal, see gForge http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=3125&start=0
item.setFlag(Factory.newCodeableConcept(s, "http://hl7.org/fhir/v3/ActStatus", s)); if (s.equals("aborted")) // only on this condition? item.setDeleted(true);
guardian.getRelationship().add(Factory.newCodeableConcept("GUARD", "urn:oid:2.16.840.1.113883.5.110", "guardian")); Element g = cda.getChild(p, "guardian"); for (Element e : cda.getChildren(g, "addr"))
public Type makeCodeableConceptFromNullFlavor(String nf) throws Exception { // Some nullFlavors have explicit values in value sets. This can only be called where there aren't. if (nf == null || "".equals(nf)) return null; if ("NI".equals(nf)) return null; // there's no code for this if ("NA".equals(nf)) return Factory.newCodeableConcept("unsupported", "http://hl7.org/fhir/data-absent-reason", "Unsupported"); // todo: is this reasonable? Why else would you use N/A? if ("UNK".equals(nf)) return Factory.newCodeableConcept("unknown", "http://hl7.org/fhir/data-absent-reason", "Unknown"); if ("ASKU".equals(nf)) return Factory.newCodeableConcept("asked", "http://hl7.org/fhir/data-absent-reason", "Asked/Unknown"); if ("NAV".equals(nf)) return Factory.newCodeableConcept("temp", "http://hl7.org/fhir/data-absent-reason", "Temporarily Unavailable"); if ("NASK".equals(nf)) return Factory.newCodeableConcept("notasked", "http://hl7.org/fhir/data-absent-reason", "Not Asked"); if ("MSK".equals(nf)) return Factory.newCodeableConcept("masked", "http://hl7.org/fhir/data-absent-reason", "Masked"); if ("OTH".equals(nf)) return null; // well, what should be done? return null; // well, what should be done? }
public static void addControl(QuestionnaireItemComponent group, String value) { group.getExtension().add(Factory.newExtension(EXT_CONTROL, Factory.newCodeableConcept(value, "http://hl7.org/fhir/questionnaire-item-control", value), true)); }
public static void addFlyOver(QuestionnaireItemComponent item, String text){ if (!StringUtils.isBlank(text)) { QuestionnaireItemComponent display = item.addItem(); display.setType(QuestionnaireItemType.DISPLAY); display.setText(text); display.getExtension().add(Factory.newExtension(EXT_CONTROL, Factory.newCodeableConcept("flyover", "http://hl7.org/fhir/questionnaire-item-control", "Fly-over"), true)); } }
cda.checkTemplateId(so, "2.16.840.1.113883.10.20.15.3.8"); obs.setCode(Factory.newCodeableConcept("11449-6", "http://loinc.org", "Pregnancy Status")); break; case SmokingStatus: cda.checkTemplateId(so, "2.16.840.1.113883.10.20.22.4.78"); obs.setCode(Factory.newCodeableConcept("72166-2", "http://loinc.org", "Tobacco Smoking Status")); break; case TobaccoUse: cda.checkTemplateId(so, "2.16.840.1.113883.10.20.22.4.12"); obs.setCode(Factory.newCodeableConcept("11367-0", "http://loinc.org", "History of Tobacco Use")); obs.setValue(Factory.newCodeableConcept("60001007", "http://snomed.info/sct", "Not pregnant")); } else { or.setType(ObservationRelationshipType.HASMEMBER); or.setTarget(Factory.makeReference("#"+id)); co.setCode(Factory.newCodeableConcept("11778-8", "http://loinc.org", "Delivery date Estimated")); co.setValue(convert.makeDateTimeFromTS(cda.getChild(dd, "value"))); // not legal, see gForge http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=3125&start=0
item.setFlag(Factory.newCodeableConcept(s, "http://hl7.org/fhir/v3/ActStatus", s)); if (s.equals("aborted")) // only on this condition? item.setDeleted(true);
guardian.getRelationship().add(Factory.newCodeableConcept("GUARD", "urn:oid:2.16.840.1.113883.5.110", "guardian")); Element g = cda.getChild(p, "guardian"); for (Element e : cda.getChildren(g, "addr"))