patient.getMaritalStatus().getCodingFirstRep().setDisplay("Married"); patient.getMaritalStatus().getCodingFirstRep().setVersion("1.0"); patient.getMaritalStatus().getCodingFirstRep().setUserSelected(true); String code = patient.getMaritalStatus().getCodingFirstRep().getCode(); String codeSystem = patient.getMaritalStatus().getCodingFirstRep().getCode(); Set<MaritalStatusCodesEnum> status = patient.getMaritalStatus().getValueAsEnum();
/** * Gets the value(s) for <b>orderedBy</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * What order applies to the items in the list * </p> */ public BoundCodeableConceptDt<ListOrderCodesEnum> getOrderedBy() { if (myOrderedBy == null) { myOrderedBy = new BoundCodeableConceptDt<ListOrderCodesEnum>(ListOrderCodesEnum.VALUESET_BINDER); } return myOrderedBy; }
@SuppressWarnings("unused") public static void codeableConcepts() { // START SNIPPET: codeableConcepts Patient patient = new Patient(); // Coded types can naturally be set using plain strings CodingDt statusCoding = patient.getMaritalStatus().addCoding(); statusCoding.setSystem("http://hl7.org/fhir/v3/MaritalStatus"); statusCoding.setCode("M"); statusCoding.setDisplay("Married"); // You could add a second coding to the field if needed too. This // can be useful if you want to convey the concept using different // codesystems. CodingDt secondStatus = patient.getMaritalStatus().addCoding(); secondStatus.setCode("H"); secondStatus.setSystem("http://example.com#maritalStatus"); secondStatus.setDisplay("Happily Married"); // CodeableConcept also has a text field meant to convey // a user readable version of the concepts it conveys. patient.getMaritalStatus().setText("Happily Married"); // There are also accessors for retrieving values String firstCode = patient.getMaritalStatus().getCoding().get(0).getCode(); String secondCode = patient.getMaritalStatus().getCoding().get(1).getCode(); // END SNIPPET: codeableConcepts }
@Override protected void render(Event adr, List<Object> columns) { columns.add(adr.getOnset()); columns.add(adr.getSubstance().getCodingFirstRep().getDisplay()); columns.add(getManifestations(adr.getManifestation())); }
/** * Sets the {@link #getCoding()} to contain a coding with the code and * system defined by the given enumerated type, AND clearing any existing * codings first. If theValue is null, existing codings are cleared and no * codings are added. * * @param theValue * The value to add, or <code>null</code> */ public void setValueAsEnum(T theValue) { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!"); getCoding().clear(); if (theValue == null) { return; } getCoding().add(new CodingDt(myBinder.toSystemString(theValue), myBinder.toCodeString(theValue))); }
@SuppressWarnings("Duplicates") @Override public Conformance addConformance(Conformance conformance){ if (metadataRepositoryConfig.isSecured()) { List<Conformance.Rest> restList = conformance.getRest(); Conformance.Rest rest = restList.get(0); Conformance.RestSecurity restSecurity = rest.getSecurity(); ExtensionDt conformanceExtension = new ExtensionDt(false, metadataRepositoryConfig.getUrisEndpointExtensionUrl()); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "authorize", new UriDt(metadataRepositoryConfig.getAuthorizeUrl()))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "token", new UriDt(metadataRepositoryConfig.getTokenUrl()))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "register", new UriDt(metadataRepositoryConfig.getRegistrationEndpointUrl()))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "launch-registration", new UriDt(metadataRepositoryConfig.getLaunchRegistrationUrl()))); restSecurity.addUndeclaredExtension(conformanceExtension); BoundCodeableConceptDt<RestfulSecurityServiceEnum> boundCodeableConceptDt = new BoundCodeableConceptDt<>( RestfulSecurityServiceEnum.VALUESET_BINDER, RestfulSecurityServiceEnum.SMART_ON_FHIR); boundCodeableConceptDt.setText("OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)"); restSecurity.getService().add(boundCodeableConceptDt); } return conformance; } }
public static int compareProblemIDs(String id1, String id2) { IdentifierDt ed1 = PCCUtil.parseProblemID(id1); IdentifierDt ed2 = PCCUtil.parseProblemID(id2); int i = ed1.getType().getCodingFirstRep().getCode().compareToIgnoreCase(ed2.getType().getCodingFirstRep().getCode()); if (i == 0) { int v1 = NumberUtils.toInt(ed1.getValue()); int v2 = NumberUtils.toInt(ed2.getValue()); i = v1 == v2 ? 0 : v1 > v2 ? 1 : -1; } return i; }
/** * Sets the {@link #getCoding()} to contain a coding with the code and * system defined by the given enumerated types, AND clearing any existing * codings first. If theValue is null, existing codings are cleared and no * codings are added. * * @param theValues * The value to add, or <code>null</code> */ public void setValueAsEnum(Collection<T> theValues) { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!"); getCoding().clear(); if (theValues != null) { for (T next : theValues) { getCoding().add(new CodingDt(myBinder.toSystemString(next), myBinder.toCodeString(next))); } } }
/** * Gets the value(s) for <b>type</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose * </p> */ public BoundCodeableConceptDt<IdentifierTypeCodesEnum> getType() { if (myType == null) { myType = new BoundCodeableConceptDt<IdentifierTypeCodesEnum>(IdentifierTypeCodesEnum.VALUESET_BINDER); } return myType; }
String name = participant == null ? null : FhirUtil.formatName(EncounterUtil.getName(participant)); lblParticipant.setValue(name); lblServiceCategory.setValue(encounter.getTypeFirstRep().getCodingFirstRep().getDisplay()); imgLocked.setVisible(EncounterUtil.isLocked(encounter));
public static IdentifierDt getIdentifier(List<IdentifierDt> list, IdentifierTypeCodesEnum... types) { for (IdentifierTypeCodesEnum type : types) { for (IdentifierDt id : list) { for (CodingDt coding : id.getType().getCoding()) { if (coding.getSystem().equals(type.getSystem()) && coding.getCode().equals(type.getCode())) { return id; } } } } return null; }
/** * Gets the value(s) for <b>type</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Indicates the type of function performed at the location * </p> */ public BoundCodeableConceptDt<LocationTypeEnum> getType() { if (myType == null) { myType = new BoundCodeableConceptDt<LocationTypeEnum>(LocationTypeEnum.VALUESET_BINDER); } return myType; }
@Override public void renderItem(Listitem item, Object data) { Encounter encounter = data instanceof Encounter ? (Encounter) data : parse((String) data); item.setValue(encounter); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); Span span = new Span(); span.setSclass(EncounterUtil.isLocked(encounter) ? Constants.SCLASS_LOCKED : null); createCell(item, span); Location location = ClientUtil.getResource(encounter.getLocationFirstRep().getLocation(), Location.class); createCell(item, location == null ? null : location.getName()); createCell(item, encounter.getPeriod().getStart()); createCell(item, encounter.getTypeFirstRep().getCodingFirstRep().getDisplay()); }
/** * Loops through the {@link #getCoding() codings} in this codeable concept * and returns the first bound enumerated type that matches. <b>Use * caution</b> using this method, see the return description for more * information. * * @return Returns the bound enumerated type, or <code>null</code> if none * are found. Note that a null return value doesn't neccesarily * imply that this Codeable Concept has no codes, only that it has * no codes that match the enum. */ public Set<T> getValueAsEnum() { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!"); Set<T> retVal = new HashSet<T>(); for (CodingDt next : getCoding()) { if (next == null) { continue; } T nextT = myBinder.fromCodeString(defaultString(next.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString())); if (nextT != null) { retVal.add(nextT); } else { // TODO: throw special exception type? } } return retVal; }
/** * Gets the value(s) for <b>maritalStatus</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * This field contains a patient's most recent marital (civil) status. * </p> */ public BoundCodeableConceptDt<MaritalStatusCodesEnum> getMaritalStatus() { if (myMaritalStatus == null) { myMaritalStatus = new BoundCodeableConceptDt<MaritalStatusCodesEnum>(MaritalStatusCodesEnum.VALUESET_BINDER); } return myMaritalStatus; }
/** * Gets the value(s) for <b>code</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes * </p> */ public BoundCodeableConceptDt<TimingAbbreviationEnum> getCode() { if (myCode == null) { myCode = new BoundCodeableConceptDt<TimingAbbreviationEnum>(TimingAbbreviationEnum.VALUESET_BINDER); } return myCode; }
/** * Sets the value(s) for <b>type</b> () * * <p> * <b>Definition:</b> * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose * </p> */ public IdentifierDt setType(IdentifierTypeCodesEnum theValue) { setType(new BoundCodeableConceptDt<IdentifierTypeCodesEnum>(IdentifierTypeCodesEnum.VALUESET_BINDER, theValue)); /* getType().setValueAsEnum(theValue); */ return this; }
/** * Sets the value(s) for <b>orderedBy</b> () * * <p> * <b>Definition:</b> * What order applies to the items in the list * </p> */ public ListResource setOrderedBy(ListOrderCodesEnum theValue) { setOrderedBy(new BoundCodeableConceptDt<ListOrderCodesEnum>(ListOrderCodesEnum.VALUESET_BINDER, theValue)); /* getOrderedBy().setValueAsEnum(theValue); */ return this; }
/** * Sets the value(s) for <b>maritalStatus</b> () * * <p> * <b>Definition:</b> * This field contains a patient's most recent marital (civil) status. * </p> */ public Patient setMaritalStatus(MaritalStatusCodesEnum theValue) { setMaritalStatus(new BoundCodeableConceptDt<MaritalStatusCodesEnum>(MaritalStatusCodesEnum.VALUESET_BINDER, theValue)); /* getMaritalStatus().setValueAsEnum(theValue); */ return this; }