private void extractTokensFromCodeableConcept(List<String> theSystems, List<String> theCodes, CodeableConcept theCodeableConcept, ResourceTable theEntity, Set<BaseResourceIndexedSearchParam> theListToPopulate, RuntimeSearchParam theParameterDef) { for (Coding nextCoding : theCodeableConcept.getCoding()) { extractTokensFromCoding(theSystems, theCodes, theEntity, theListToPopulate, theParameterDef, nextCoding); } }
private boolean hasConcept(org.hl7.fhir.dstu3.model.CodeableConcept cc, String system, String code) { for (org.hl7.fhir.dstu3.model.Coding c : cc.getCoding()) { if (system.equals(c.getSystem()) && code.equals(c.getCode())) return true; } return false; }
private void checkCodeableConcept(List<ValidationMessage> errors, String path, Element focus, CodeableConcept fixed) { checkFixedValue(errors, path + ".text", focus.getNamedChild("text"), fixed.getTextElement(), "text", focus); List<Element> codings = new ArrayList<Element>(); focus.getNamedChildren("coding", codings); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, codings.size() == fixed.getCoding().size(), "Expected " + Integer.toString(fixed.getCoding().size()) + " but found " + Integer.toString(codings.size()) + " coding elements")) { for (int i = 0; i < codings.size(); i++) checkFixedValue(errors, path + ".coding", codings.get(i), fixed.getCoding().get(i), "coding", focus); } }
private String ccSummary(CodeableConcept cc) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); for (Coding c : cc.getCoding()) b.append(c.getSystem()+"#"+c.getCode()); return b.toString(); }
public org.hl7.fhir.instance.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.CodeableConcept tgt = new org.hl7.fhir.instance.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); tgt.setText(src.getText()); return tgt; }
public static org.hl7.fhir.dstu2016may.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.CodeableConcept tgt = new org.hl7.fhir.dstu2016may.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); if (src.hasText()) tgt.setText(src.getText()); return tgt; }
private ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCodeIsInContains(List<ValueSetExpansionContainsComponent> contains, String theSystem, String theCode, Coding theCoding, CodeableConcept theCodeableConcept) { for (ValueSetExpansionContainsComponent nextCode : contains) { ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult result = validateCodeIsInContains(nextCode.getContains(), theSystem, theCode, theCoding, theCodeableConcept); if (result != null) { return result; } String system = nextCode.getSystem(); String code = nextCode.getCode(); if (isNotBlank(theCode)) { if (theCode.equals(code) && (isBlank(theSystem) || theSystem.equals(system))) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } else if (theCoding != null) { if (StringUtils.equals(system, theCoding.getSystem()) && StringUtils.equals(code, theCoding.getCode())) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } else { for (Coding next : theCodeableConcept.getCoding()) { if (StringUtils.equals(system, next.getSystem()) && StringUtils.equals(code, next.getCode())) { return new ValidateCodeResult(true, "Validation succeeded", nextCode.getDisplay()); } } } } return null; }
String ss = type.getCoding().get(0).getCode(); if (ss.equals("416098002") || ss.equals("414285001")) ai.setType(AllergyIntoleranceType.ALLERGY);
boolean haveCodeableConcept = theCodeableConcept != null && theCodeableConcept.getCoding().size() > 0; boolean haveCoding = theCoding != null && theCoding.isEmpty() == false; boolean haveCode = theCode != null && theCode.isEmpty() == false;
Coding c = new Coding(); c.setCode(cda.getChild(l, "languageCode").getAttribute("code")); cc.getCoding().add(c); pat.addCommunication().setLanguage(cc);
public static boolean addType(EncounterParticipantComponent participant, Coding participationType) { if (!hasType(participant, participationType)) { CodeableConcept cpt = participant.addType(); cpt.getCoding().add(participationType); return true; } return false; }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("coding")) { this.getCoding().add(castToCoding(value)); } else if (name.equals("text")) { this.text = castToString(value); // StringType } else return super.setProperty(name, value); return value; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -1355086998: // coding this.getCoding().add(castToCoding(value)); // Coding return value; case 3556653: // text this.text = castToString(value); // StringType return value; default: return super.setProperty(hash, name, value); } }
private String ccSummary(CodeableConcept cc) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); for (Coding c : cc.getCoding()) b.append(c.getSystem()+"#"+c.getCode()); return b.toString(); }
if (binding.getStrength() != BindingStrength.EXAMPLE) { boolean atLeastOneSystemIsSupported = false; for (Coding nextCoding : cc.getCoding()) { String nextSystem = nextCoding.getSystem(); if (isNotBlank(nextSystem) && context.supportsSystem(nextSystem)) { for (Coding nextCoding : cc.getCoding()) { String nextCode = nextCoding.getCode(); String nextSystem = nextCoding.getSystem();
public org.hl7.fhir.instance.model.AuditEvent.AuditEventParticipantComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.AuditEvent.AuditEventParticipantComponent tgt = new org.hl7.fhir.instance.model.AuditEvent.AuditEventParticipantComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(convertCodeableConcept(t)); tgt.setReference(convertReference(src.getReference())); tgt.setUserId(convertIdentifier(src.getUserId())); tgt.setAltId(src.getAltId()); tgt.setName(src.getName()); tgt.setRequestor(src.getRequestor()); tgt.setLocation(convertReference(src.getLocation())); for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); tgt.setMedia(convertCoding(src.getMedia())); tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(convertCoding(cc)); return tgt; }
public static CodeableConcept newCodeableConcept(String code, String system, String display) { CodeableConcept cc = new CodeableConcept(); Coding c = new Coding(); c.setCode(code); c.setSystem(system); c.setDisplay(display); cc.getCoding().add(c); return cc; }
public org.hl7.fhir.instance.model.AuditEvent convertAuditEvent(org.hl7.fhir.dstu3.model.AuditEvent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.AuditEvent tgt = new org.hl7.fhir.instance.model.AuditEvent(); copyDomainResource(src, tgt); tgt.getEvent().setType(convertCoding(src.getType())); for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(convertCoding(t)); tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); tgt.getEvent().setDateTime(src.getRecorded()); tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(convertCoding(cc)); for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t)); tgt.setSource(convertAuditEventSourceComponent(src.getSource())); for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t)); return tgt; }
public static String getServiceCategory(Encounter encounter) { CodeableConcept cpt = encounter == null ? null : FhirUtil.getFirst(encounter.getType()); Coding coding = cpt == null ? null : FhirUtil.getFirst(cpt.getCoding()); return coding == null ? null : coding.getCode(); }
public org.hl7.fhir.instance.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.CodeableConcept tgt = new org.hl7.fhir.instance.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); tgt.setText(src.getText()); return tgt; }