TransformerUtils { static Extension createExtensionCoding(IAnyResource rootResource, CcwCodebookVariable ccwVariable, Optional<?> code) { if (!code.isPresent()) throw new IllegalArgumentException(); Coding coding = createCoding(rootResource, ccwVariable, code.get()); String extensionUrl = calculateVariableReferenceUrl(ccwVariable); Extension extension = new Extension(extensionUrl, coding); return extension; }  static String buildEobId(ClaimType claimType, String claimId); static IdDt buildPatientId(Beneficiary beneficiary); static IdDt buildPatientId(String beneficiaryId); static IdDt buildCoverageId(MedicareSegment medicareSegment, Beneficiary beneficiary); static IdDt buildCoverageId(MedicareSegment medicareSegment, String beneficiaryId); static List<Diagnosis> extractDiagnoses1Thru12(Optional<String> diagnosisPrincipalCode,
			Optional<Character> diagnosisPrincipalCodeVersion, Optional<String> diagnosis1Code,
			Optional<Character> diagnosis1CodeVersion, Optional<String> diagnosis2Code,
			Optional<Character> diagnosis2CodeVersion, Optional<String> diagnosis3Code,
			Optional<Character> diagnosis3CodeVersion, Optional<String> diagnosis4Code,
			Optional<Character> diagnosis4CodeVersion, Optional<String> diagnosis5Code,
			Optional<Character> diagnosis5CodeVersion, Optional<String> diagnosis6Code,
			Optional<Character> diagnosis6CodeVersion, Optional<String> diagnosis7Code,
			Optional<Character> diagnosis7CodeVersion, Optional<String> diagnosis8Code,
			Optional<Character> diagnosis8CodeVersion, Optional<String> diagnosis9Code,
			Optional<Character> diagnosis9CodeVersion, Optional<String> diagnosis10Code,
			Optional<Character> diagnosis10CodeVersion, Optional<String> diagnosis11Code,
			Optional<Character> diagnosis11CodeVersion, Optional<String> diagnosis12Code,
			Optional<Character> diagnosis12CodeVersion); static List<Diagnosis> extractDiagnoses13Thru25(Optional<String> diagnosis13Code,
			Optional<Character> diagnosis13CodeVersion, Optional<String> diagnosis14Code,
			Optional<Character> diagnosis14CodeVersion, Optional<String> diagnosis15Code,
			Optional<Character> diagnosis15CodeVersion, Optional<String> diagnosis16Code,
			Optional<Character> diagnosis16CodeVersion, Optional<String> diagnosis17Code,
			Optional<Character> diagnosis17CodeVersion, Optional<String> diagnosis18Code,
			Optional<Character> diagnosis18CodeVersion, Optional<String> diagnosis19Code,
			Optional<Character> diagnosis19CodeVersion, Optional<String> diagnosis20Code,
			Optional<Character> diagnosis20CodeVersion, Optional<String> diagnosis21Code,
			Optional<Character> diagnosis21CodeVersion, Optional<String> diagnosis22Code,
			Optional<Character> diagnosis22CodeVersion, Optional<String> diagnosis23Code,
			Optional<Character> diagnosis23CodeVersion, Optional<String> diagnosis24Code,
			Optional<Character> diagnosis24CodeVersion, Optional<String> diagnosis25Code,
			Optional<Character> diagnosis25CodeVersion); static List<Diagnosis> extractExternalDiagnoses1Thru12(Optional<String> diagnosisExternalFirstCode,
			Optional<Character> diagnosisExternalFirstCodeVersion, Optional<String> diagnosisExternal1Code,
			Optional<Character> diagnosisExternal1CodeVersion, Optional<String> diagnosisExternal2Code,
			Optional<Character> diagnosisExternal2CodeVersion, Optional<String> diagnosisExternal3Code,
			Optional<Character> diagnosisExternal3CodeVersion, Optional<String> diagnosisExternal4Code,
			Optional<Character> diagnosisExternal4CodeVersion, Optional<String> diagnosisExternal5Code,
			Optional<Character> diagnosisExternal5CodeVersion, Optional<String> diagnosisExternal6Code,
			Optional<Character> diagnosisExternal6CodeVersion, Optional<String> diagnosisExternal7Code,
			Optional<Character> diagnosisExternal7CodeVersion, Optional<String> diagnosisExternal8Code,
			Optional<Character> diagnosisExternal8CodeVersion, Optional<String> diagnosisExternal9Code,
			Optional<Character> diagnosisExternal9CodeVersion, Optional<String> diagnosisExternal10Code,
			Optional<Character> diagnosisExternal10CodeVersion, Optional<String> diagnosisExternal11Code,
			Optional<Character> diagnosisExternal11CodeVersion, Optional<String> diagnosisExternal12Code,
			Optional<Character> diagnosisExternal12CodeVersion); static List<CCWProcedure> extractCCWProcedures(Optional<String> procedure1Code,
			Optional<Character> procedure1CodeVersion, Optional<LocalDate> procedure1Date,
			Optional<String> procedure2Code, Optional<Character> procedure2CodeVersion,
			Optional<LocalDate> procedure2Date, Optional<String> procedure3Code,
			Optional<Character> procedure3CodeVersion, Optional<LocalDate> procedure3Date,
			Optional<String> procedure4Code, Optional<Character> procedure4CodeVersion,
			Optional<LocalDate> procedure4Date, Optional<String> procedure5Code,
			Optional<Character> procedure5CodeVersion, Optional<LocalDate> procedure5Date,
			Optional<String> procedure6Code, Optional<Character> procedure6CodeVersion,
			Optional<LocalDate> procedure6Date, Optional<String> procedure7Code,
			Optional<Character> procedure7CodeVersion, Optional<LocalDate> procedure7Date,
			Optional<String> procedure8Code, Optional<Character> procedure8CodeVersion,
			Optional<LocalDate> procedure8Date, Optional<String> procedure9Code,
			Optional<Character> procedure9CodeVersion, Optional<LocalDate> procedure9Date,
			Optional<String> procedure10Code, Optional<Character> procedure10CodeVersion,
			Optional<LocalDate> procedure10Date, Optional<String> procedure11Code,
			Optional<Character> procedure11CodeVersion, Optional<LocalDate> procedure11Date,
			Optional<String> procedure12Code, Optional<Character> procedure12CodeVersion,
			Optional<LocalDate> procedure12Date, Optional<String> procedure13Code,
			Optional<Character> procedure13CodeVersion, Optional<LocalDate> procedure13Date,
			Optional<String> procedure14Code, Optional<Character> procedure14CodeVersion,
			Optional<LocalDate> procedure14Date, Optional<String> procedure15Code,
			Optional<Character> procedure15CodeVersion, Optional<LocalDate> procedure15Date,
			Optional<String> procedure16Code, Optional<Character> procedure16CodeVersion,
			Optional<LocalDate> procedure16Date, Optional<String> procedure17Code,
			Optional<Character> procedure17CodeVersion, Optional<LocalDate> procedure17Date,
			Optional<String> procedure18Code, Optional<Character> procedure18CodeVersion,
			Optional<LocalDate> procedure18Date, Optional<String> procedure19Code,
			Optional<Character> procedure19CodeVersion, Optional<LocalDate> procedure19Date,
			Optional<String> procedure20Code, Optional<Character> procedure20CodeVersion,
			Optional<LocalDate> procedure20Date, Optional<String> procedure21Code,
			Optional<Character> procedure21CodeVersion, Optional<LocalDate> procedure21Date,
			Optional<String> procedure22Code, Optional<Character> procedure22CodeVersion,
			Optional<LocalDate> procedure22Date, Optional<String> procedure23Code,
			Optional<Character> procedure23CodeVersion, Optional<LocalDate> procedure23Date,
			Optional<String> procedure24Code, Optional<Character> procedure24CodeVersion,
			Optional<LocalDate> procedure24Date, Optional<String> procedure25Code,
			Optional<Character> procedure25CodeVersion, Optional<LocalDate> procedure25Date); static String retrieveIcdCodeDisplay(String icdCode); static String retrieveNpiCodeDisplay(String npiCode); static String retrieveProcedureCodeDisplay(String procedureCode); static String retrieveFDADrugCodeDisplay(String claimDrugCode); static Map<String, String> readFDADrugCodeFile(); static Bundle createBundle(PagingArguments pagingArgs, String resourceType, String identifier, String value,
			List<IBaseResource> resources); static Bundle addResourcesToBundle(Bundle bundle, List<IBaseResource> resources); static void addPagingLinks(PagingArguments pagingArgs, Bundle bundle, String resource, String searchByDesc,
			String identifier, int numTotalResults); static Extension createIdentifierCurrencyExtension(CurrencyIdentifier currencyIdentifier); static void recordQueryInMdc(String queryId, long queryDurationNanoseconds, long recordCount);  }
@Test public void createExtensionCoding() { Patient patientA = new Patient(); patientA.setId("12345"); Extension extension = TransformerUtils.createExtensionCoding(patientA, CcwCodebookVariable.RACE, "4"); Assert.assertNotNull(extension); Assert.assertEquals(TransformerConstants.BASE_URL_CCW_VARIABLES + "/race", extension.getUrl()); Assert.assertTrue(extension.getValue() instanceof Coding); Coding coding = (Coding) extension.getValue(); Assert.assertNotNull(coding); Assert.assertEquals(TransformerConstants.BASE_URL_CCW_VARIABLES + "/race", coding.getSystem()); Assert.assertEquals("4", coding.getCode()); }