001 002package ca.uhn.fhir.model.dstu2.valueset; 003 004import ca.uhn.fhir.model.api.*; 005import java.util.HashMap; 006import java.util.Map; 007 008public enum ObservationRelationshipTypeEnum { 009 010 /** 011 * Display: <b>Has Member</b><br> 012 * Code Value: <b>has-member</b> 013 * 014 * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. 015 */ 016 HAS_MEMBER("has-member", "http://hl7.org/fhir/observation-relationshiptypes"), 017 018 /** 019 * Display: <b>Derived From</b><br> 020 * Code Value: <b>derived-from</b> 021 * 022 * The target resource (Observation or QuestionnaireResponse) is part of the information from which this observation value is derived. (e.g. calculated anion gap, Apgar score) NOTE: "derived-from" is only logical choice when referencing QuestionnaireResponse. 023 */ 024 DERIVED_FROM("derived-from", "http://hl7.org/fhir/observation-relationshiptypes"), 025 026 /** 027 * Display: <b>Sequel To</b><br> 028 * Code Value: <b>sequel-to</b> 029 * 030 * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). 031 */ 032 SEQUEL_TO("sequel-to", "http://hl7.org/fhir/observation-relationshiptypes"), 033 034 /** 035 * Display: <b>Replaces</b><br> 036 * Code Value: <b>replaces</b> 037 * 038 * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. 039 */ 040 REPLACES("replaces", "http://hl7.org/fhir/observation-relationshiptypes"), 041 042 /** 043 * Display: <b>Qualified By</b><br> 044 * Code Value: <b>qualified-by</b> 045 * 046 * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipemia measure target from a plasma measure). 047 */ 048 QUALIFIED_BY("qualified-by", "http://hl7.org/fhir/observation-relationshiptypes"), 049 050 /** 051 * Display: <b>Interfered By</b><br> 052 * Code Value: <b>interfered-by</b> 053 * 054 * The value of the target observation interferes (degrades quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). 055 */ 056 INTERFERED_BY("interfered-by", "http://hl7.org/fhir/observation-relationshiptypes"), 057 058 ; 059 060 /** 061 * Identifier for this Value Set: 062 * 063 */ 064 public static final String VALUESET_IDENTIFIER = ""; 065 066 /** 067 * Name for this Value Set: 068 * ObservationRelationshipType 069 */ 070 public static final String VALUESET_NAME = "ObservationRelationshipType"; 071 072 private static Map<String, ObservationRelationshipTypeEnum> CODE_TO_ENUM = new HashMap<String, ObservationRelationshipTypeEnum>(); 073 private static Map<String, Map<String, ObservationRelationshipTypeEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, ObservationRelationshipTypeEnum>>(); 074 075 private final String myCode; 076 private final String mySystem; 077 078 static { 079 for (ObservationRelationshipTypeEnum next : ObservationRelationshipTypeEnum.values()) { 080 CODE_TO_ENUM.put(next.getCode(), next); 081 082 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 083 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, ObservationRelationshipTypeEnum>()); 084 } 085 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 086 } 087 } 088 089 /** 090 * Returns the code associated with this enumerated value 091 */ 092 public String getCode() { 093 return myCode; 094 } 095 096 /** 097 * Returns the code system associated with this enumerated value 098 */ 099 public String getSystem() { 100 return mySystem; 101 } 102 103 /** 104 * Returns the enumerated value associated with this code 105 */ 106 public static ObservationRelationshipTypeEnum forCode(String theCode) { 107 ObservationRelationshipTypeEnum retVal = CODE_TO_ENUM.get(theCode); 108 return retVal; 109 } 110 111 /** 112 * Converts codes to their respective enumerated values 113 */ 114 public static final IValueSetEnumBinder<ObservationRelationshipTypeEnum> VALUESET_BINDER = new IValueSetEnumBinder<ObservationRelationshipTypeEnum>() { 115 @Override 116 public String toCodeString(ObservationRelationshipTypeEnum theEnum) { 117 return theEnum.getCode(); 118 } 119 120 @Override 121 public String toSystemString(ObservationRelationshipTypeEnum theEnum) { 122 return theEnum.getSystem(); 123 } 124 125 @Override 126 public ObservationRelationshipTypeEnum fromCodeString(String theCodeString) { 127 return CODE_TO_ENUM.get(theCodeString); 128 } 129 130 @Override 131 public ObservationRelationshipTypeEnum fromCodeString(String theCodeString, String theSystemString) { 132 Map<String, ObservationRelationshipTypeEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 133 if (map == null) { 134 return null; 135 } 136 return map.get(theCodeString); 137 } 138 139 }; 140 141 /** 142 * Constructor 143 */ 144 ObservationRelationshipTypeEnum(String theCode, String theSystem) { 145 myCode = theCode; 146 mySystem = theSystem; 147 } 148 149 150}