├── miscellaneous ├── audit-service │ ├── README.md │ ├── Ballerina.toml │ ├── .choreo │ │ └── endpoints.yaml │ ├── .gitignore │ ├── tests │ │ └── service_test.bal │ └── records.bal ├── fhirpath-service │ ├── README.md │ ├── Ballerina.toml │ └── service.bal ├── validator-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── service_utils.bal │ └── README.md ├── terminology-service │ ├── tests │ │ ├── resources │ │ │ ├── code_systems │ │ │ │ ├── invalid-json-payload.json │ │ │ │ ├── add-invalid-codesystem.json │ │ │ │ ├── subsumed.json │ │ │ │ ├── add-invalid-codesystem.xml │ │ │ │ ├── subsumed-by.json │ │ │ │ ├── subsume-equal.json │ │ │ │ ├── subsume-notequal.json │ │ │ │ ├── empty-bundle.json │ │ │ │ ├── concepts-array-input.json │ │ │ │ ├── account-status-inactive.json │ │ │ │ ├── account-status-inactive2.json │ │ │ │ ├── designation-input.json │ │ │ │ ├── subsume-error2.json │ │ │ │ ├── subsume-error.json │ │ │ │ ├── lookup-error2.json │ │ │ │ ├── concepts-array-expected.json │ │ │ │ ├── add-invalid-codesystem-response.json │ │ │ │ ├── get-by-id-failure.json │ │ │ │ ├── lookup-error.json │ │ │ │ ├── designation-expected.json │ │ │ │ └── add-valid-codesystem.xml │ │ │ ├── value_sets │ │ │ │ ├── add-invalid-valueset.json │ │ │ │ ├── batch_validation │ │ │ │ │ ├── no-entries-batch-request.json │ │ │ │ │ ├── invalid-json-batch-request.json │ │ │ │ │ ├── not-batch-type-request.json │ │ │ │ │ ├── valid-batch-request.json │ │ │ │ │ ├── no-entries-batch-response.json │ │ │ │ │ ├── not-batch-type-response.json │ │ │ │ │ ├── invalid-json-batch-response.json │ │ │ │ │ └── valid-batch-response.json │ │ │ │ ├── coding-as-parameter.json │ │ │ │ ├── validate-code.json │ │ │ │ ├── add-valid-valueset5.json │ │ │ │ ├── lookup-error2.json │ │ │ │ ├── add-invalid-valueset-response.json │ │ │ │ ├── lookup-error.json │ │ │ │ ├── expand-error.json │ │ │ │ ├── add-valid-valueset.json │ │ │ │ ├── add-valid-valueset2.json │ │ │ │ ├── add-valid-valueset3.json │ │ │ │ ├── add-valid-valueset4.json │ │ │ │ ├── expand-account-and-resource-status.json │ │ │ │ ├── expanded-relationship.json │ │ │ │ ├── account-status.json │ │ │ │ ├── expanded-example-valueset-include-concepts.json │ │ │ │ ├── expanded-example-valueset-include-valueset.json │ │ │ │ ├── expanded-account-status-active-filter.json │ │ │ │ ├── account-status-as-parameter.json │ │ │ │ ├── account-status-as-parameter2.json │ │ │ │ └── expanded-account-status.json │ │ │ ├── zip │ │ │ │ ├── test.zip │ │ │ │ ├── loinc.zip │ │ │ │ ├── valueset.zip │ │ │ │ └── codesystem.zip │ │ │ └── concepts │ │ │ │ ├── bundle-search-active-with-pagination.json │ │ │ │ └── bundle-search-active.json │ │ └── Config.toml │ ├── .devcontainer.json │ ├── resources │ │ └── database │ │ │ └── terminologyDB.mv.db │ ├── .gitignore │ ├── Ballerina.toml │ ├── modules │ │ ├── store │ │ │ ├── persist_db_config.bal │ │ │ └── script.sql │ │ ├── snomed_to_fhir │ │ │ └── snomed_to_fhir.bal │ │ └── loinc_to_fhir │ │ │ ├── loinc_to_fhir.bal │ │ │ └── types.bal │ ├── configs.bal │ ├── query_builder.bal │ ├── persist │ │ └── model.bal │ └── README.md └── authz-fhirr4-service │ ├── README.md │ └── Ballerina.toml ├── ehr-connectivity ├── cerner-fhirr4-workflow-api-service │ ├── .gitignore │ ├── Ballerina.toml │ └── .choreo │ │ └── endpoints.yaml ├── epic-fhirr4-clinical-api-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── allergyintolerance_api_config.bal │ └── README.md ├── epic-fhirr4-financial-api-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── enrollment_response_api_config.bal │ ├── enrollment_request_api_config.bal │ ├── vision_prescription_api_config.bal │ └── payment_notice_api_config.bal ├── epic-fhirr4-workflow-api-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── README.md │ └── schedule_api_config.bal ├── epic-fhirr4-administration-api-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── .choreo │ │ └── endpoints.yaml │ ├── practitionerrole_api_config.bal │ ├── organization_api_config.bal │ ├── practitioner_api_config.bal │ ├── relatedperson_api_config.bal │ └── README.md ├── epic-fhirr4-diagnostics-api-service │ ├── .gitignore │ ├── Ballerina.toml │ └── README.md ├── epic-fhirr4-medications-api-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── medication_api_config.bal │ ├── immunization_api_config.bal │ └── README.md └── cerner-fhirr4-administration-api-service │ ├── .gitignore │ ├── Ballerina.toml │ ├── .choreo │ └── endpoints.yaml │ ├── practitionerrole_api_config.bal │ ├── organization_api_config.bal │ └── relatedperson_api_config.bal ├── transformation ├── v2-to-fhirr4-service │ ├── tests │ │ └── Config.toml │ ├── create-prebuilt-service-v2-fhir.png │ ├── Ballerina.toml │ ├── service_openapi.yaml │ └── service.bal └── ccda-to-fhirr4-service │ ├── tests │ ├── test_invalid_ccda_document.xml │ └── service_test.bal │ ├── Ballerina.toml │ ├── .choreo │ └── component.yaml │ ├── README.md │ └── service.bal ├── conformance ├── metadata-fhirr4-service │ ├── Ballerina.toml │ ├── resources │ │ └── fhir_resources.json │ ├── tests │ │ ├── Config.toml │ │ ├── test_generator.bal │ │ ├── sample_invalid_fhir_resources.json │ │ ├── sample_fhir_resources.json │ │ └── test_service.bal │ ├── .choreo │ │ └── endpoints.yaml │ ├── Config.toml │ ├── model_openid_configuration.bal │ ├── utils_generator.bal │ ├── constants.bal │ └── service.bal └── smart-config-fhirr4-service │ ├── Ballerina.toml │ ├── tests │ ├── test_service.bal │ └── Config.toml │ ├── constants.bal │ ├── Config.toml │ ├── utils_generator.bal │ ├── service.bal │ ├── model_openid_configuration.bal │ ├── model_smart_configuration.bal │ └── model_config.bal ├── .github └── workflows │ ├── cd-hl7v2-to-fhir.yml │ └── daily-build.yml ├── .gitignore ├── issue_template.md ├── README.md └── pull_request_template.md /miscellaneous/audit-service/README.md: -------------------------------------------------------------------------------- 1 | # Audit service -------------------------------------------------------------------------------- /miscellaneous/fhirpath-service/README.md: -------------------------------------------------------------------------------- 1 | # FHIRPath Service 2 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-workflow-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-clinical-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-financial-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-workflow-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-diagnostics-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-medications-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /miscellaneous/validator-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | .devcontainer.json 5 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-administration-api-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/invalid-json-payload.json: -------------------------------------------------------------------------------- 1 | { "field": "Value" } 2 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/Config.toml: -------------------------------------------------------------------------------- 1 | db_type = "h2" 2 | 3 | [terminology_service.store] 4 | user = "" 5 | password = "" 6 | url = "" 7 | 8 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/add-invalid-codesystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "CodeSystem", 3 | "status": "active" 4 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-invalid-valueset.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "name": "InvalidValueSet" 4 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/.devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "ballerina/ballerina-devcontainer:2201.6.0", 3 | "extensions": ["WSO2.ballerina"], 4 | } 5 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/no-entries-batch-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "type": "batch" 4 | } 5 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/zip/test.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/open-healthcare-prebuilt-services/HEAD/miscellaneous/terminology-service/tests/resources/zip/test.zip -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/zip/loinc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/open-healthcare-prebuilt-services/HEAD/miscellaneous/terminology-service/tests/resources/zip/loinc.zip -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/invalid-json-batch-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "type": "batch", 4 | "entry": "invalid-entry" 5 | } 6 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/zip/valueset.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/open-healthcare-prebuilt-services/HEAD/miscellaneous/terminology-service/tests/resources/zip/valueset.zip -------------------------------------------------------------------------------- /miscellaneous/authz-fhirr4-service/README.md: -------------------------------------------------------------------------------- 1 | # FHIR Authorization Service Accelerator 2 | 3 | This accelerator can be used to get the basic patient and privilege user based authorization policies for FHIR APIs. -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/zip/codesystem.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/open-healthcare-prebuilt-services/HEAD/miscellaneous/terminology-service/tests/resources/zip/codesystem.zip -------------------------------------------------------------------------------- /transformation/v2-to-fhirr4-service/tests/Config.toml: -------------------------------------------------------------------------------- 1 | [customMapper] 2 | baseUrl = "http://localhost:9091/v2tofhir" 3 | 4 | [customMapper.segmentMappings] 5 | NK1 = "/segment/nk1" 6 | PID = "/segment/pid" 7 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/resources/database/terminologyDB.mv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/open-healthcare-prebuilt-services/HEAD/miscellaneous/terminology-service/resources/database/terminologyDB.mv.db -------------------------------------------------------------------------------- /transformation/v2-to-fhirr4-service/create-prebuilt-service-v2-fhir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/open-healthcare-prebuilt-services/HEAD/transformation/v2-to-fhirr4-service/create-prebuilt-service-v2-fhir.png -------------------------------------------------------------------------------- /miscellaneous/terminology-service/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | generated 3 | Config.toml 4 | temp_files 5 | .vscode 6 | *.db 7 | 8 | !test.zip 9 | !codesystem.zip 10 | !valueset.zip 11 | !loinc.zip 12 | !terminologyDB.mv.db 13 | -------------------------------------------------------------------------------- /miscellaneous/validator-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "validator_service" 4 | version = "0.1.1" 5 | distribution = "2201.12.3" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | 10 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "MetadataService" 4 | version = "2.0.0" 5 | distribution = "2201.10.2" 6 | authors = ["Ballerina"] 7 | keywords = ["Healthcare","FHIR","Metadata"] 8 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "SmartConfigService" 4 | version = "2.0.0" 5 | authors = ["Ballerina"] 6 | keywords = ["Healthcare", "FHIR", "SMART"] 7 | distribution = "2201.10.2" 8 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-clinical-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "EpicFhirR4ClinicalApiService" 4 | version = "0.1.0" 5 | distribution = "2201.8.6" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-workflow-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "CernerFhirR4WorkflowApiService" 4 | version = "0.1.0" 5 | distribution = "2201.8.6" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-diagnostics-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "EpicFhirR4DiagnosticsApiService" 4 | version = "0.1.0" 5 | distribution = "2201.8.6" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-financial-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "EpicFhirR4FinancialApiService" 4 | version = "0.1.0" 5 | distribution = "2201.8.6" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-medications-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "EpicFhirR4MedicationsApiService" 4 | version = "0.1.0" 5 | distribution = "2201.8.6" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-workflow-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "epic_fhirr4_workflow_api_service" 4 | version = "0.1.0" 5 | distribution = "2201.8.6" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/subsumed.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "valueCode": "subsumed", 6 | "name": "outcome" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /transformation/ccda-to-fhirr4-service/tests/test_invalid_ccda_document.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-administration-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "CernerFhirR4AdministrationApiService" 4 | version = "0.1.0" 5 | distribution = "2201.8.5" 6 | 7 | [build-options] 8 | observabilityIncluded = true 9 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/add-invalid-codesystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/subsumed-by.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "valueCode": "subsumed-by", 6 | "name": "outcome" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /transformation/ccda-to-fhirr4-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "CcdaToFhirR4Service" 4 | version = "0.9.0" 5 | distribution = "2201.12.3" 6 | authors = ["Ballerina"] 7 | keywords = ["Healthcare", "CCDA to FHIR", "FHIR", "CCDA"] 8 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/subsume-equal.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "valueCode": "equivalent", 6 | "name": "outcome" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/subsume-notequal.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "valueCode": "not-subsumed", 6 | "name": "outcome" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.github/workflows/cd-hl7v2-to-fhir.yml: -------------------------------------------------------------------------------- 1 | name: CD - HL7 V2 to FHIR 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | uses: ./.github/workflows/cd-executor.yml 9 | secrets: inherit 10 | with: 11 | working_dir: ./transformations/v2-to-fhirr4-service -------------------------------------------------------------------------------- /miscellaneous/fhirpath-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "FHIRPathService" 4 | authors = ["Ballerina"] 5 | keywords = ["Healthcare", "FHIR", "FHIRPATH"] 6 | version = "1.0.1" 7 | distribution = "2201.10.2" 8 | 9 | [build-options] 10 | observabilityIncluded = true 11 | -------------------------------------------------------------------------------- /miscellaneous/audit-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Ballerina"] 3 | distribution = "2201.10.2" 4 | export = ["FhirAuditService"] 5 | keywords = ["Healthcare", "Audit", "Prebuilt", "Service"] 6 | name = "FhirAuditService" 7 | org = "wso2" 8 | version = "1.0.0" 9 | 10 | [build-options] 11 | observabilityIncluded = true 12 | -------------------------------------------------------------------------------- /miscellaneous/authz-fhirr4-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "FHIRAuthzService" 4 | version = "1.0.0" 5 | export = ["FHIRAuthzService"] 6 | distribution = "2201.10.2" 7 | authors = ["Ballerina"] 8 | keywords = ["Healthcare", "FHIR", "Authorization", "Service"] 9 | 10 | [build-options] 11 | observabilityIncluded = true 12 | -------------------------------------------------------------------------------- /transformation/v2-to-fhirr4-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "Hl7v2ToFhirR4Service" 4 | version = "1.2.0" 5 | distribution = "2201.10.2" 6 | authors = ["Ballerina"] 7 | keywords = ["Healthcare","FHIR","HL7V2", "Transform"] 8 | 9 | [build-options] 10 | observabilityIncluded = true 11 | optimizeDependencyCompilation = true -------------------------------------------------------------------------------- /miscellaneous/audit-service/.choreo/endpoints.yaml: -------------------------------------------------------------------------------- 1 | # +required Version of the endpoint configuration YAML 2 | version: 0.1 3 | 4 | # +required List of endpoints to create 5 | endpoints: 6 | - name: Audit Service API 7 | port: 9093 8 | type: REST 9 | networkVisibility: Public 10 | context: / 11 | schemaFilePath: oas/AuditServiceAPI.yaml 12 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "terminology_service" 4 | version = "0.1.1" 5 | distribution = "2201.12.3" 6 | template=true 7 | 8 | [build-options] 9 | observabilityIncluded = true 10 | 11 | [[platform.java21.dependency]] 12 | groupId = "io.ballerina.stdlib" 13 | artifactId = "persist.sql-native" 14 | version = "1.6.0" 15 | 16 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/empty-bundle.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "meta": { 4 | "lastUpdated": "2025-03-17T04:34:19.412137400Z", 5 | "profile": [ 6 | "http://hl7.org/fhir/StructureDefinition/Bundle" 7 | ] 8 | }, 9 | "type": "searchset", 10 | "total": 0, 11 | "entry": [] 12 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/not-batch-type-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "type": "transaction", 4 | "entry": [ 5 | { 6 | "request": { 7 | "method": "GET", 8 | "url": "/%24validate-code?system=http://hl7.org/fhir/ValueSet/account-status&code=inactive" 9 | } 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /transformation/ccda-to-fhirr4-service/.choreo/component.yaml: -------------------------------------------------------------------------------- 1 | schemaVersion: 1.1 2 | endpoints: 3 | - name: ccda-to-fhirr4-service 4 | displayName: CCDA to FHIR R4 Service 5 | service: 6 | basePath: / 7 | port: 9090 8 | type: REST 9 | networkVisibilities: 10 | - Project 11 | - Public 12 | schemaFilePath: oas/service_openapi.yaml 13 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/concepts-array-input.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "code": "example-code-1", 4 | "display": "Example Code 1", 5 | "definition": "This is an example code 1." 6 | }, 7 | { 8 | "code": "example-code-2", 9 | "display": "Example Code 2", 10 | "definition": "This is an example code 2." 11 | } 12 | ] -------------------------------------------------------------------------------- /miscellaneous/terminology-service/modules/store/persist_db_config.bal: -------------------------------------------------------------------------------- 1 | // AUTO-GENERATED FILE. DO NOT MODIFY. 2 | 3 | // This file is an auto-generated file by Ballerina persistence layer. 4 | // It should not be modified by hand. 5 | 6 | import ballerinax/java.jdbc; 7 | 8 | configurable string url = ?; 9 | configurable string user = ?; 10 | configurable string password = ?; 11 | configurable jdbc:Options & readonly connectionOptions = {}; 12 | 13 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/coding-as-parameter.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/Parameters"] 5 | }, 6 | "parameter": [ 7 | { 8 | "name": "coding", 9 | "valueCoding": { 10 | "system": "http://hl7.org/fhir/account-status", 11 | "code": "inactive", 12 | "display": "Inactive" 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /miscellaneous/audit-service/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | # Ballerina 26 | target/ 27 | Config.toml 28 | .vscode/ 29 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/validate-code.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "name": "result", 6 | "valueBoolean": true 7 | }, 8 | { 9 | "name": "display", 10 | "valueString": "Inactive" 11 | }, 12 | { 13 | "name": "definition", 14 | "valueString": "This account is inactive and should not be used to track financial information." 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/account-status-inactive.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "name": "name", 6 | "valueString": "inactive" 7 | }, 8 | { 9 | "name": "display", 10 | "valueString": "Inactive" 11 | }, 12 | { 13 | "name": "definition", 14 | "valueString": "This account is inactive and should not be used to track financial information." 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/valid-batch-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "type": "batch", 4 | "entry": [ 5 | { 6 | "request": { 7 | "method": "GET", 8 | "url": "/%24validate-code?system=http://hl7.org/fhir/ValueSet/account-status&code=inactive" 9 | } 10 | }, 11 | { 12 | "request": { 13 | "method": "GET", 14 | "url": "/%24validate-code?system=http://hl7.org/fhir/ValueSet/account-status&code=active" 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | # Ballerina 26 | target/ 27 | Config.toml 28 | Cloud.toml 29 | 30 | # IDE specific configuration files 31 | .idea/ 32 | .vscode/ 33 | 34 | # Mac configuration file 35 | .DS_Store 36 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/Ballerina.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | org = "wso2" 3 | name = "EpicFhirR4AdministrationApiService" 4 | version = "0.9.0" 5 | distribution = "2201.12.3" 6 | 7 | # [[dependency]] 8 | # org = "ballerinax" 9 | # name = "health.fhir.r4" 10 | # version = "5.1.0" 11 | 12 | # [[dependency]] 13 | # org = "ballerinax" 14 | # name = "health.fhirr4" 15 | # version = "1.3.1" 16 | 17 | # [[dependency]] 18 | # org = "ballerinax" 19 | # name = "health.clients.fhir" 20 | # version = "2.0.0" 21 | 22 | [build-options] 23 | observabilityIncluded = true 24 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/account-status-inactive2.json: -------------------------------------------------------------------------------- 1 | { 2 | "parameter": [ 3 | { 4 | "name": "result", 5 | "value": "true", 6 | "resource": null 7 | }, 8 | { 9 | "name": "display", 10 | "value": "Inactive", 11 | "resource": null 12 | }, 13 | { 14 | "name": "definition", 15 | "value": "This account is inactive and should not be used to track financial information.", 16 | "resource": null 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/designation-input.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "example-code", 3 | "display": "Example Code", 4 | "property": [ 5 | { 6 | "code": "example-property-code", 7 | "valueString": "example-property-value" 8 | } 9 | ], 10 | "designation": [ 11 | { 12 | "language": "en", 13 | "value": "Example Designation", 14 | "use": { 15 | "system": "http://example.org", 16 | "code": "example-use-code" 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/no-entries-batch-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/OperationOutcome"] 5 | }, 6 | "issue": [ 7 | { 8 | "severity": "error", 9 | "code": "required", 10 | "details": { 11 | "coding": [ 12 | { 13 | "system": "http://hl7.org/fhir/issue-type", 14 | "code": "400" 15 | } 16 | ], 17 | "text": "No entries in the bundle" 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/not-batch-type-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/OperationOutcome"] 5 | }, 6 | "issue": [ 7 | { 8 | "severity": "error", 9 | "code": "required", 10 | "details": { 11 | "coding": [ 12 | { 13 | "system": "http://hl7.org/fhir/issue-type", 14 | "code": "400" 15 | } 16 | ], 17 | "text": "Not a batch type bundle" 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/subsume-error2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "issue": [ 4 | { 5 | "severity": "error", 6 | "diagnostics": "01ee1fdf-d531-125e-86e4-72e7a1b2a154 : The payload should contain 2 Coding concepts to execute this operation", 7 | "code": "required", 8 | "details": { 9 | "coding": [ 10 | { 11 | "system": "http://hl7.org/fhir/issue-type", 12 | "code": "400" 13 | } 14 | ], 15 | "text": "Missing required input parameters" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/invalid-json-batch-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/OperationOutcome"] 5 | }, 6 | "issue": [ 7 | { 8 | "severity": "error", 9 | "code": "required", 10 | "details": { 11 | "coding": [ 12 | { 13 | "system": "http://hl7.org/fhir/issue-type", 14 | "code": "400" 15 | } 16 | ], 17 | "text": "Cannot parse request as a FHIR Bundle" 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/resources/fhir_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "Patient", 4 | "versioning": "versioned", 5 | "conditionalCreate": false, 6 | "conditionalRead": "not-supported", 7 | "conditionalUpdate": false, 8 | "conditionalDelete": "not-supported", 9 | "referencePolicies": ["resolves"], 10 | "searchRevIncludes": ["null"], 11 | "supportedProfiles": ["http://hl7.org/fhir/StructureDefinition/Patient"], 12 | "interaction": ["create", "delete", "update", "history-type", "search-type", "vread", "read"], 13 | "stringSearchParams": ["_lastUpdated", "_security", "_tag", "_source", "_profile"], 14 | "numberSearchParams": ["_id"] 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-valid-valueset5.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "id": "account-and-resource-status", 4 | "url": "http://hl7.org/fhir/ValueSet/account-and-resource-status", 5 | "name": "AccountAndAbstractTypes", 6 | "title": "Account Status and Abstract Types", 7 | "status": "active", 8 | "version": "1.0.1", 9 | "description": "A ValueSet that includes all codes from account-status and abstract-types CodeSystems.", 10 | "compose": { 11 | "include": [ 12 | { 13 | "system": "http://hl7.org/fhir/account-status" 14 | }, 15 | { 16 | "system": "http://hl7.org/fhir/resource-status" 17 | } 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/subsume-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "issue": [ 4 | { 5 | "severity": "error", 6 | "diagnostics": "01ee1fd3-5c2b-1d10-877c-b29ac6c03308 : The request should conain 2 code concepts or 2 coding concepts and CodeSystem system URL", 7 | "code": "required", 8 | "details": { 9 | "coding": [ 10 | { 11 | "system": "http://hl7.org/fhir/issue-type", 12 | "code": "400" 13 | } 14 | ], 15 | "text": "Missing required input parameters" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/lookup-error2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01ee1fd9-03f7-1cde-b763-15b8e9227c30", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Invalid Coding value" 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/lookup-error2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01ee1fd9-03f7-1cde-b763-15b8e9227c30", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Invalid request payload" 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/concepts-array-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "name": "name", 6 | "valueString": "example-code-1" 7 | }, 8 | { 9 | "name": "display", 10 | "valueString": "Example Code 1" 11 | }, 12 | { 13 | "name": "definition", 14 | "valueString": "This is an example code 1." 15 | }, 16 | { 17 | "name": "name", 18 | "valueString": "example-code-2" 19 | }, 20 | { 21 | "name": "display", 22 | "valueString": "Example Code 2" 23 | }, 24 | { 25 | "name": "definition", 26 | "valueString": "This is an example code 2." 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/concepts/bundle-search-active-with-pagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/Bundle" 6 | ] 7 | }, 8 | "type": "searchset", 9 | "total": 2, 10 | "entry": [ 11 | { 12 | "resource": { 13 | "system": "http://hl7.org/fhir/resource-status", 14 | "code": "active", 15 | "display": "active" 16 | } 17 | }, 18 | { 19 | "resource": { 20 | "system": "http://hl7.org/fhir/resource-status", 21 | "code": "inactive", 22 | "display": "inactive" 23 | } 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-invalid-valueset-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01f0150f-8182-1a18-94f2-641fed742b3c", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Invalid request payload" 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/add-invalid-codesystem-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01f0150d-2a7b-1cd0-8c79-3be444e08f11", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Invalid request payload" 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/get-by-id-failure.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01ee1f1d-f467-17e8-847a-bf9e7d43b3a2", 12 | "code": "not-found", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "404" 18 | } 19 | ], 20 | "text": "Unknown CodeSystem: 'account-status2'" 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /miscellaneous/audit-service/tests/service_test.bal: -------------------------------------------------------------------------------- 1 | import ballerina/http; 2 | import ballerina/test; 3 | import ballerinax/health.fhir.r4.international401; 4 | 5 | http:Client testClient = check new ("http://localhost:9093"); 6 | 7 | // Test functions 8 | @test:Config {} 9 | function testSendingAuditEvent1() { 10 | InternalAuditEvent auditEvent = {"typeCode": "rest", "subTypeCode": "READ", "actionCode": "R", "outcomeCode": "0", "recordedTime": "2023-10-23T17:36:35.395477Z", "agentType": "", "agentName": "Unknown", "agentIsRequestor": true, "sourceObserverName": "", "sourceObserverType": "3", "entityType": "2", "entityRole": "1", "entityWhatReference": ""}; 11 | international401:AuditEvent|error response = testClient->/audits.post(auditEvent); 12 | test:assertEquals(response is international401:AuditEvent, true); 13 | } 14 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/lookup-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01ee1fd7-c050-1940-ac33-15e83bd3f8ba : Either ValueSet record or system URL should be provided as input", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Can not find a ValueSet" 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/lookup-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01ee1fd7-c050-1940-ac33-15e83bd3f8ba : Either CodeSystem record or system URL should be provided as input", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Can not find a CodeSystem" 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | **Description:** 2 | 3 | 4 | **Suggested Labels:** 5 | 6 | 7 | **Suggested Assignees:** 8 | 9 | 10 | **Affected Product Version:** 11 | 12 | **OS, DB, other environment details and versions:** 13 | 14 | **Steps to reproduce:** 15 | 16 | 17 | **Related Issues:** 18 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/tests/Config.toml: -------------------------------------------------------------------------------- 1 | ## server related configurables 2 | [configFHIRServer] 3 | version = "1.2.0" 4 | name = "WSO2 Open Healthcare FHIR" 5 | title = "FHIR Server" 6 | status = "active" 7 | experimental = true 8 | date = "2022-11-24" 9 | kind = "instance" 10 | fhirVersion = "4.0.1" 11 | format = ["json"] 12 | patchFormat = ["application/json-patch+json"] 13 | implementationUrl = "" 14 | implementationDescription = "WSO2 Open Healthcare FHIR" 15 | 16 | ## server security related configurables 17 | [configRest] 18 | mode = "server" 19 | resourceFilePath = "resources/fhir_resources.json" 20 | interaction = ["search-system"] 21 | [configRest.security] 22 | cors = false 23 | discoveryEndpoint = "https://api.asgardeo.io/t/bifrost/oauth2/token/.well-known/openid-configuration" 24 | managementEndpoint = "" 25 | 26 | [ballerina.log] 27 | level = "DEBUG" 28 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expand-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "OperationOutcome", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 6 | ] 7 | }, 8 | "issue": [ 9 | { 10 | "severity": "error", 11 | "diagnostics": "01f0008b-2cc4-1466-97d3-6a3b6d451850 : Either ValueSet record or system URL should be provided as input", 12 | "code": "required", 13 | "details": { 14 | "coding": [ 15 | { 16 | "system": "http://hl7.org/fhir/issue-type", 17 | "code": "400" 18 | } 19 | ], 20 | "text": "Cannot find a ValueSet due to Either ValueSet record or system URL should be provided as input" 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /transformation/v2-to-fhirr4-service/service_openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.1 2 | info: 3 | title: Service Openapi Yaml 4 | version: 1.1.0 5 | servers: 6 | - url: "{server}:{port}/" 7 | variables: 8 | server: 9 | default: http://localhost 10 | port: 11 | default: "9090" 12 | paths: 13 | /transform: 14 | post: 15 | operationId: postTransform 16 | requestBody: 17 | content: 18 | text/plain: 19 | schema: 20 | type: string 21 | responses: 22 | "200": 23 | description: Ok 24 | "400": 25 | description: BadRequest 26 | content: 27 | text/plain: 28 | schema: 29 | type: string 30 | "500": 31 | description: InternalServerError 32 | content: 33 | text/plain: 34 | schema: 35 | type: string 36 | components: {} 37 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/.choreo/endpoints.yaml: -------------------------------------------------------------------------------- 1 | # +required Version of the endpoint configuration YAML 2 | version: 0.1 3 | 4 | # +required List of endpoints to create 5 | endpoints: 6 | # +required Unique name for the endpoint. (This name will be used when generating the managed API) 7 | - name: Metadata API 8 | # +required Numeric port value that gets exposed via this endpoint 9 | port: 9090 10 | # +required Type of the traffic this endpoint is accepting. Example: REST, GraphQL, etc. 11 | # Allowed values: REST, GraphQL, GRPC 12 | type: REST 13 | # +optional Network level visibility of this endpoint. Defaults to Project 14 | # Accepted values: Project|Organization|Public. 15 | networkVisibility: Public 16 | # +optional Context (base path) of the API that is exposed via this endpoint. 17 | # This is mandatory if the endpoint type is set to REST or GraphQL. 18 | context: /fhir/r4/metadata 19 | schemaFilePath: oas/capability_statement.yaml 20 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/.choreo/endpoints.yaml: -------------------------------------------------------------------------------- 1 | # +required Version of the endpoint configuration YAML 2 | version: 0.1 3 | 4 | # +required List of endpoints to create 5 | endpoints: 6 | # +required Unique name for the endpoint. (This name will be used when generating the managed API) 7 | - name: EPIC FHIR Patient API 8 | # +required Numeric port value that gets exposed via this endpoint 9 | port: 9090 10 | # +required Type of the traffic this endpoint is accepting. Example: REST, GraphQL, etc. 11 | # Allowed values: REST, GraphQL, GRPC 12 | type: REST 13 | # +optional Network level visibility of this endpoint. Defaults to Project 14 | # Accepted values: Project|Organization|Public. 15 | networkVisibility: Public 16 | # +optional Context (base path) of the API that is exposed via this endpoint. 17 | # This is mandatory if the endpoint type is set to REST or GraphQL. 18 | context: / 19 | schemaFilePath: oas/PatientAPI.yaml 20 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-valid-valueset.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "id": "cdcrec-all", 4 | "url": "http://example.org/fhir/ValueSet/cdcrec-all", 5 | "version": "1.0.0", 6 | "name": "CDCRECAll", 7 | "title": "CDC Race and Ethnicity - All Codes", 8 | "status": "active", 9 | "date": "2025-04-09", 10 | "publisher": "Example Publisher", 11 | "contact": [ 12 | { 13 | "name": "Example Team", 14 | "telecom": [ 15 | { 16 | "system": "email", 17 | "value": "support@example.org" 18 | } 19 | ] 20 | } 21 | ], 22 | "description": "A ValueSet that includes all codes from the CDC Race and Ethnicity CodeSystem (urn:oid:2.16.840.1.113883.6.238).", 23 | "compose": { 24 | "include": [ 25 | { 26 | "system": "urn:oid:2.16.840.1.113883.6.238" 27 | } 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/concepts/bundle-search-active.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/Bundle" 6 | ] 7 | }, 8 | "type": "searchset", 9 | "total": 3, 10 | "entry": [ 11 | { 12 | "resource": { 13 | "system": "http://hl7.org/fhir/resource-status", 14 | "code": "active", 15 | "display": "active" 16 | } 17 | }, 18 | { 19 | "resource": { 20 | "system": "http://hl7.org/fhir/account-status", 21 | "code": "inactive", 22 | "display": "Inactive" 23 | } 24 | }, 25 | { 26 | "resource": { 27 | "system": "http://hl7.org/fhir/resource-status", 28 | "code": "inactive", 29 | "display": "inactive" 30 | } 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-valid-valueset2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "id": "example-valueset-include-valueset", 4 | "url": "http://example.org/fhir/ValueSet/example-include-valueset", 5 | "version": "1.0.0", 6 | "name": "ExampleIncludeValueSet", 7 | "title": "Example ValueSet with Include ValueSet", 8 | "status": "active", 9 | "date": "2025-04-09", 10 | "publisher": "Example Publisher", 11 | "contact": [ 12 | { 13 | "name": "Example Team", 14 | "telecom": [ 15 | { 16 | "system": "email", 17 | "value": "support@example.org" 18 | } 19 | ] 20 | } 21 | ], 22 | "description": "A ValueSet that includes other ValueSets using compose.include.valueSet.", 23 | "compose": { 24 | "include": [ 25 | { 26 | "valueSet": [ 27 | "http://hl7.org/fhir/ValueSet/abstract-types", 28 | "http://hl7.org/fhir/ValueSet/account-status" 29 | ] 30 | } 31 | ] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-workflow-api-service/.choreo/endpoints.yaml: -------------------------------------------------------------------------------- 1 | # +required Version of the endpoint configuration YAML 2 | version: 0.1 3 | 4 | # +required List of endpoints to create 5 | endpoints: 6 | - name: Cerner FHIR Appointment API 7 | port: 9099 8 | type: REST 9 | networkVisibility: Public 10 | context: / 11 | schemaFilePath: oas/AppointmentAPI.yaml 12 | - name: Cerner FHIR AppointmentResponse API 13 | port: 9100 14 | type: REST 15 | networkVisibility: Public 16 | context: / 17 | schemaFilePath: oas/AppointmentResponseAPI.yaml 18 | - name: Cerner FHIR Schedule API 19 | port: 9097 20 | type: REST 21 | networkVisibility: Public 22 | context: / 23 | schemaFilePath: oas/ScheduleAPI.yaml 24 | - name: Cerner FHIR ServiceRequest API 25 | port: 9101 26 | type: REST 27 | networkVisibility: Public 28 | context: / 29 | schemaFilePath: oas/ServiceRequestAPI.yaml 30 | - name: Cerner FHIR Slot API 31 | port: 9098 32 | type: REST 33 | networkVisibility: Public 34 | context: / 35 | schemaFilePath: oas/SlotAPI.yaml 36 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-valid-valueset3.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "id": "example-valueset-include-both", 4 | "url": "http://example.org/fhir/ValueSet/example-include-both", 5 | "version": "1.0.0", 6 | "name": "ExampleIncludeBoth", 7 | "title": "Example ValueSet with Include ValueSet and CodeSystem", 8 | "status": "active", 9 | "date": "2025-04-09", 10 | "publisher": "Example Publisher", 11 | "contact": [ 12 | { 13 | "name": "Example Team", 14 | "telecom": [ 15 | { 16 | "system": "email", 17 | "value": "support@example.org" 18 | } 19 | ] 20 | } 21 | ], 22 | "description": "A ValueSet that includes both another ValueSet and a CodeSystem in compose.include.", 23 | "compose": { 24 | "include": [ 25 | { 26 | "valueSet": [ 27 | "http://hl7.org/fhir/ValueSet/abstract-types" 28 | ] 29 | }, 30 | { 31 | "system": "http://hl7.org/fhir/abstract-types" 32 | } 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/Config.toml: -------------------------------------------------------------------------------- 1 | ## server related configurables 2 | [configFHIRServer] 3 | version = "1.2.0" 4 | name = "WSO2 Open Healthcare FHIR" 5 | title = "FHIR Server" 6 | status = "active" 7 | experimental = true 8 | # The date field below will be populated with server current time if not specified from the config. 9 | # date = "2022-11-24" 10 | kind = "instance" 11 | fhirVersion = "4.0.1" 12 | format = ["json", "ttl"] 13 | patchFormat = ["application/json-patch+json"] 14 | implementationUrl = "" 15 | implementationDescription = "WSO2 Open Healthcare FHIR" 16 | 17 | ## server security related configurables 18 | [configRest] 19 | mode = "server" 20 | resourceFilePath = "resources/fhir_resources.json" 21 | interaction = ["search-system"] 22 | [configRest.security] 23 | cors = false 24 | # The discoveryEndpoint provided below is for a sample OIDC server. Please replace it with your own OIDC server's discovery endpoint. 25 | discoveryEndpoint = "https://api.asgardeo.io/t/bitfrost/oauth2/token/.well-known/openid-configuration" 26 | managementEndpoint = "https://api.asgardeo.io/t//oauth2/manage" 27 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/tests/test_service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerina/test; 19 | 20 | @test:Config {groups: ["Service"]} 21 | function testService() returns error? { 22 | http:Client testClient = check new ("http://localhost:9090"); 23 | json|error response = testClient -> /fhir/r4/\.well\-known/smart\-configuration; 24 | if response is error { 25 | test:assertFail(response.message()); 26 | } 27 | test:assertTrue(true, "Test service success"); 28 | } 29 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/constants.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | public const SMART_CONFIGURATION = "SmartConfiguration"; 18 | public const OPERATION_OUTCOME = "OperationOutcome"; 19 | 20 | public const VALUE_NOT_FOUND = "Value not found"; 21 | public const INTERNAL_SERVER_ERROR = "Internal server error occured"; 22 | public const ERROR_OCCURRED = "Error occurred"; 23 | public const SMART_CONFIGURATION_FAILED = "Smart configuration generation failed"; 24 | public const CONTACT_SERVER_ADMIN = "Please contact server admin if the issue persists"; 25 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/modules/snomed_to_fhir/snomed_to_fhir.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | import ballerina/http; 17 | import ballerinax/health.fhir.r4; 18 | 19 | public const string FHIR_SNOMED_FILE_NAME = "/snomed-codesystem.json"; 20 | 21 | public isolated function convert(string filePath, string? version) returns error? { 22 | return r4:createFHIRError( 23 | "SNOMED upload is not implemented yet", 24 | r4:ERROR, 25 | r4:INVALID_REQUIRED, 26 | httpStatusCode = http:STATUS_NOT_IMPLEMENTED); 27 | } 28 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-administration-api-service/.choreo/endpoints.yaml: -------------------------------------------------------------------------------- 1 | # +required Version of the endpoint configuration YAML 2 | version: 0.1 3 | 4 | # +required List of endpoints to create 5 | endpoints: 6 | - name: Cerner FHIR Patient API 7 | port: 9090 8 | type: REST 9 | networkVisibility: Public 10 | context: / 11 | schemaFilePath: oas/PatientAPI.yaml 12 | - name: Cerner FHIR Practitioner API 13 | port: 9092 14 | type: REST 15 | networkVisibility: Public 16 | context: / 17 | schemaFilePath: oas/PractitionerAPI.yaml 18 | - name: Cerner FHIR Encounter API 19 | port: 9094 20 | type: REST 21 | networkVisibility: Public 22 | context: / 23 | schemaFilePath: oas/EncounterAPI.yaml 24 | - name: Cerner FHIR Location API 25 | port: 9095 26 | type: REST 27 | networkVisibility: Public 28 | context: / 29 | schemaFilePath: oas/LocationAPI.yaml 30 | - name: Cerner FHIR Organization API 31 | port: 9091 32 | type: REST 33 | networkVisibility: Public 34 | context: / 35 | schemaFilePath: oas/OrganizationAPI.yaml 36 | - name: Cener FHIR RelatedPerson API 37 | port: 9096 38 | type: REST 39 | networkVisibility: Public 40 | context: / 41 | schemaFilePath: oas/RelatedPersonAPI.yaml 42 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/tests/test_generator.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/test; 18 | import ballerinax/health.fhir.r4.international401; 19 | 20 | @test:Config {groups: ["Generator"]} 21 | function testGenerateCapabilityStatement() returns error? { 22 | international401:CapabilityStatement|error capabilityStatement = generateCapabilityStatement(); 23 | 24 | if capabilityStatement is international401:CapabilityStatement { 25 | test:assertTrue(true, "Capability generation success"); 26 | } else { 27 | test:assertFail("Capability generation failed"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /miscellaneous/audit-service/records.bal: -------------------------------------------------------------------------------- 1 | // Holds the information needed to form an audit event based on the FHIR AuditEvent resource 2 | // http://hl7.org/fhir/R4/auditevent.html 3 | type InternalAuditEvent record {| 4 | // Value Set http://hl7.org/fhir/ValueSet/audit-event-type 5 | string typeCode = "rest"; 6 | // Value Set http://hl7.org/fhir/ValueSet/audit-event-sub-type 7 | string subTypeCode; 8 | // Value Set http://hl7.org/fhir/ValueSet/audit-event-action 9 | string actionCode; 10 | // Value Set http://hl7.org/fhir/ValueSet/audit-event-outcome 11 | string outcomeCode; 12 | string recordedTime; 13 | // actor involved in the event 14 | // Value Set http://hl7.org/fhir/ValueSet/participation-role-type 15 | string agentType; 16 | string agentName; 17 | boolean agentIsRequestor; 18 | // source of the event 19 | string sourceObserverName; 20 | // Value Set http://hl7.org/fhir/R4/valueset-audit-source-type.html 21 | string sourceObserverType; 22 | // Value Set http://hl7.org/fhir/ValueSet/audit-entity-type 23 | string entityType; 24 | // Value Set http://hl7.org/fhir/ValueSet/object-role 25 | string entityRole; 26 | // Requested relative path - eg.: "Patient/example/_history/1" 27 | string entityWhatReference; 28 | 29 | |}; 30 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/batch_validation/valid-batch-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/Bundle"] 5 | }, 6 | "type": "batch-response", 7 | "entry": [ 8 | { 9 | "resource": { 10 | "resourceType": "Parameters", 11 | "parameter": [ 12 | { 13 | "name": "result", 14 | "valueBoolean": true 15 | }, 16 | { 17 | "name": "display", 18 | "valueString": "Inactive" 19 | }, 20 | { 21 | "name": "definition", 22 | "valueString": "This account is inactive and should not be used to track financial information." 23 | } 24 | ] 25 | } 26 | }, 27 | { 28 | "resource": { 29 | "resourceType": "Parameters", 30 | "parameter": [ 31 | { 32 | "name": "result", 33 | "valueBoolean": true 34 | }, 35 | { 36 | "name": "display", 37 | "valueString": "Active" 38 | }, 39 | { 40 | "name": "definition", 41 | "valueString": "This account is active and may be used." 42 | } 43 | ] 44 | } 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/model_openid_configuration.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | # OpenID configuration. 18 | # 19 | # + token_endpoint - token endpoint 20 | # + authorization_endpoint - authorization endpoint 21 | # + revocation_endpoint - revocation endpoint 22 | # + introspection_endpoint - introspection endpoint 23 | # + registration_endpoint - registration endpoint 24 | # + management_endpoint - management endpoint 25 | public type OpenIDConfiguration record { 26 | string token_endpoint?; 27 | string authorization_endpoint?; 28 | string revocation_endpoint?; 29 | string introspection_endpoint?; 30 | string registration_endpoint?; 31 | string management_endpoint?; 32 | }; 33 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-medications-api-service/medication_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig medicationApiConfig = { 21 | resourceType: "Medication", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | ], 28 | operations: [ 29 | 30 | ], 31 | serverConfig: (), 32 | authzConfig: () 33 | }; 34 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/designation-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "parameter": [ 4 | { 5 | "name": "name", 6 | "valueString": "example-code" 7 | }, 8 | { 9 | "name": "display", 10 | "valueString": "Example Code" 11 | }, 12 | { 13 | "name": "property", 14 | "part": [ 15 | { 16 | "name": "code", 17 | "valueCode": "example-property-code" 18 | }, 19 | { 20 | "name": "value", 21 | "valueString": "example-property-value" 22 | } 23 | ] 24 | }, 25 | { 26 | "name": "designation", 27 | "part": [ 28 | { 29 | "name": "language", 30 | "valueCode": "en" 31 | }, 32 | { 33 | "name": "value", 34 | "valueString": "Example Designation" 35 | }, 36 | { 37 | "name": "use", 38 | "valueCoding": { 39 | "system": "http://example.org", 40 | "code": "example-use-code" 41 | } 42 | } 43 | ] 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/tests/sample_invalid_fhir_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "versioning": "versioned", 4 | "conditionalCreate": false, 5 | "conditionalRead": "not-supported", 6 | "conditionalUpdate": false, 7 | "conditionalDelete": "not-supported", 8 | "referencePolicies": ["resolves"], 9 | "searchRevIncludes": ["null"], 10 | "supportedProfiles": ["http://hl7.org/fhir/us/Davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug"], 11 | "interactions": ["create", "delete", "update", "history-type", "search-type", "vread", "read"], 12 | "searchParamString": ["DrugTier", "DrugPlan", "DrugName", "lastUpdated", "security", "tag", "source", "profile"], 13 | "searchParamNumber": ["id"] 14 | }, 15 | { 16 | "type": "Patient", 17 | "versioning": "versioned", 18 | "conditionalCreate": false, 19 | "conditionalRead": "not-supported", 20 | "conditionalUpdate": false, 21 | "conditionalDelete": "not-supported", 22 | "referencePolicies": ["resolves"], 23 | "searchRevIncludes": ["null"], 24 | "supportedProfiles": ["http://hl7.org/fhir/us/Davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug"], 25 | "interactions": ["create", "delete", "update", "history-type", "search-type", "vread", "read"], 26 | "searchParamString": ["DrugTier", "DrugPlan", "DrugName", "lastUpdated", "security", "tag", "source", "profile"] 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/tests/sample_fhir_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "Patient", 4 | "versioning": "versioned", 5 | "conditionalCreate": false, 6 | "conditionalRead": "not-supported", 7 | "conditionalUpdate": false, 8 | "conditionalDelete": "not-supported", 9 | "referencePolicies": ["resolves"], 10 | "searchRevIncludes": ["null"], 11 | "supportedProfiles": ["http://hl7.org/fhir/us/Davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug"], 12 | "interactions": ["create", "delete", "update", "history-type", "search-type", "vread", "read"], 13 | "searchParamString": ["DrugTier", "DrugPlan", "DrugName", "lastUpdated", "security", "tag", "source", "profile"], 14 | "searchParamNumber": ["id"] 15 | }, 16 | { 17 | "type": "Patient", 18 | "versioning": "versioned", 19 | "conditionalCreate": false, 20 | "conditionalRead": "not-supported", 21 | "conditionalUpdate": false, 22 | "conditionalDelete": "not-supported", 23 | "referencePolicies": ["resolves"], 24 | "searchRevIncludes": ["null"], 25 | "supportedProfiles": ["http://hl7.org/fhir/us/Davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug"], 26 | "interactions": ["create", "delete", "update", "history-type", "search-type", "vread", "read"], 27 | "searchParamString": ["DrugTier", "DrugPlan", "DrugName", "lastUpdated", "security", "tag", "source", "profile"] 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/tests/Config.toml: -------------------------------------------------------------------------------- 1 | [configs] 2 | discoveryEndpoint = "https://api.asgardeo.io/t/bifrost/oauth2/token/.well-known/openid-configuration" 3 | 4 | [configs.smartConfiguration] 5 | tokenEndpoint = "" 6 | introspectionEndpoint = "" 7 | codeChallengeMethodsSupported = ["S256"] 8 | grantTypesSupported = ["authorization_code"] 9 | revocationEndpoint = "" 10 | tokenEndpointAuthMethodsSupported = ["private_key_jwt", "client_secret_basic"] 11 | tokenEndpointAuthSigningAlgValuesSupported = ["RS384","ES384"] 12 | scopesSupported = [ 13 | "openid", 14 | "fhirUser", 15 | "launch", 16 | "launch/patient", 17 | "patient/*.cruds", 18 | "user/*.cruds", 19 | "offline_access", 20 | ] 21 | responseTypesSupported = [ 22 | "code", 23 | "id_token", 24 | "token", 25 | "device", 26 | "id_token token" 27 | ] 28 | capabilities = [ 29 | "launch-ehr", 30 | "launch-standalone", 31 | "client-public", 32 | "client-confidential-symmetric", 33 | "client-confidential-asymmetric", 34 | "context-passthrough-banner", 35 | "context-passthrough-style", 36 | "context-ehr-patient", 37 | "context-ehr-encounter", 38 | "context-standalone-patient", 39 | "context-standalone-encounter", 40 | "permission-offline", 41 | "permission-patient", 42 | "permission-user", 43 | "permission-v2", 44 | "authorize-post" 45 | ] 46 | 47 | [ballerina.log] 48 | level = "DEBUG" 49 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/add-valid-valueset4.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "id": "example-valueset-include-concepts", 4 | "url": "http://example.org/fhir/ValueSet/example-include-concepts", 5 | "version": "1.0.0", 6 | "name": "ExampleIncludeConcepts", 7 | "title": "Example ValueSet with Include Concepts", 8 | "status": "active", 9 | "date": "2025-04-09", 10 | "publisher": "Example Publisher", 11 | "contact": [ 12 | { 13 | "name": "Example Team", 14 | "telecom": [ 15 | { 16 | "system": "email", 17 | "value": "support@example.org" 18 | } 19 | ] 20 | } 21 | ], 22 | "description": "A ValueSet that includes specific concepts from the same CodeSystem using compose.include.", 23 | "compose": { 24 | "include": [ 25 | { 26 | "system": "http://hl7.org/fhir/account-status", 27 | "concept": [ 28 | { 29 | "code": "active", 30 | "display": "Active" 31 | }, 32 | { 33 | "code": "inactive", 34 | "display": "Inactive" 35 | }, 36 | { 37 | "code": "entered-in-error", 38 | "display": "Entered in Error" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | } -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/Config.toml: -------------------------------------------------------------------------------- 1 | [configs] 2 | # The discoveryEndpoint provided below is for a sample OIDC server. Please replace it with your own OIDC server's discovery endpoint. 3 | discoveryEndpoint = "https://api.asgardeo.io/t/bifrost/oauth2/token/.well-known/openid-configuration" 4 | 5 | [configs.smartConfiguration] 6 | tokenEndpoint = "" 7 | introspectionEndpoint = "" 8 | codeChallengeMethodsSupported = ["S256"] 9 | grantTypesSupported = ["authorization_code"] 10 | revocationEndpoint = "" 11 | tokenEndpointAuthMethodsSupported = ["private_key_jwt", "client_secret_basic"] 12 | tokenEndpointAuthSigningAlgValuesSupported = ["RS384","ES384"] 13 | scopesSupported = [ 14 | "openid", 15 | "fhirUser", 16 | "launch", 17 | "launch/patient", 18 | "patient/*.cruds", 19 | "user/*.cruds", 20 | "offline_access", 21 | ] 22 | responseTypesSupported = [ 23 | "code", 24 | "id_token", 25 | "token", 26 | "device", 27 | "id_token token" 28 | ] 29 | capabilities = [ 30 | "launch-ehr", 31 | "launch-standalone", 32 | "client-public", 33 | "client-confidential-symmetric", 34 | "client-confidential-asymmetric", 35 | "context-passthrough-banner", 36 | "context-passthrough-style", 37 | "context-ehr-patient", 38 | "context-ehr-encounter", 39 | "context-standalone-patient", 40 | "context-standalone-encounter", 41 | "permission-offline", 42 | "permission-patient", 43 | "permission-user", 44 | "permission-v2", 45 | "authorize-post" 46 | ] 47 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expand-account-and-resource-status.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/ValueSet" 6 | ] 7 | }, 8 | "description": "A ValueSet that includes all codes from account-status and abstract-types CodeSystems.", 9 | "title": "Account Status and Abstract Types", 10 | "id": "account-and-resource-status", 11 | "version": "1.0.1", 12 | "url": "http://hl7.org/fhir/ValueSet/account-and-resource-status", 13 | "expansion": { 14 | "contains": [ 15 | { 16 | "code": "active", 17 | "display": "Active" 18 | }, 19 | { 20 | "code": "inactive", 21 | "display": "Inactive" 22 | }, 23 | { 24 | "code": "active", 25 | "display": "active" 26 | }, 27 | { 28 | "code": "inactive", 29 | "display": "inactive" 30 | } 31 | ], 32 | "total": 4, 33 | "offset": 0, 34 | "timestamp": "2025-05-26T08:46:14.800651800Z" 35 | }, 36 | "compose": { 37 | "include": [ 38 | { 39 | "system": "http://hl7.org/fhir/account-status" 40 | }, 41 | { 42 | "system": "http://hl7.org/fhir/resource-status" 43 | } 44 | ] 45 | }, 46 | "name": "AccountAndAbstractTypes", 47 | "status": "active" 48 | } -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/utils_generator.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerina/io; 19 | import ballerina/log; 20 | import ballerina/url; 21 | 22 | # Call the discovery endpoint to get the OpenID configuration. 23 | # 24 | # + discoveryEndpoint - Discovery endpoint 25 | # + return - If successful, returns OpenID configuration as a json. Else returns error. 26 | public isolated function getOpenidConfigurations(string discoveryEndpoint) returns OpenIDConfiguration|error { 27 | log:printDebug("Retrieving openid configuration started"); 28 | string discoveryEndpointUrl = check url:decode(discoveryEndpoint, "UTF8"); 29 | io:print(discoveryEndpointUrl); 30 | http:Client discoveryEpClient = check new (discoveryEndpointUrl.toString()); 31 | OpenIDConfiguration openidConfiguration = check discoveryEpClient ->/; 32 | log:printDebug("Retrieving openid configuration ended"); 33 | return openidConfiguration; 34 | } 35 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/configs.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | import ballerinax/health.fhir.r4.terminology; 17 | 18 | //Constants 19 | const TYPE_HEADER = "x-terminology-type"; 20 | const ZIP_FILE_NAME = "/terminology.zip"; 21 | const ZIP_FILE_EXTRACTION_PATH = "/extracted"; 22 | const FHIR_PACKAGE_PATH = "/hl7.terminology.r4/package"; 23 | const TEMPORARY_FILES_DIRECTORY_NAME = "temp_files"; 24 | 25 | // enums 26 | enum SearchCodeProperties { 27 | DISPLAY = terminology:DISPLAY, 28 | DEFINITION = terminology:DEFINITION 29 | }; 30 | 31 | enum ContentType { 32 | FHIR_JSON = "application/fhir+json", 33 | FHIR_XML = "application/fhir+xml", 34 | JSON = "application/json", 35 | XML = "application/xml", 36 | ZIP = "application/zip" 37 | } 38 | 39 | enum TerminologyType { 40 | SNOMED = "SNOMED", 41 | LOINC = "LOINC", 42 | ICD10 = "ICD10", 43 | RXNORM = "RXNORM", 44 | FHIR = "FHIR" 45 | } 46 | 47 | // Configurable Parameters 48 | configurable string db_type = "postgresql"; 49 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/modules/loinc_to_fhir/loinc_to_fhir.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | import ballerina/io; 17 | import ballerinax/health.fhir.r4; 18 | 19 | // Function to read the LOINC CSV file 20 | isolated function readLoincCsv(string path) returns LoincConcept[]|error { 21 | LoincConcept[]|io:Error content = io:fileReadCsv(path); 22 | return content; 23 | } 24 | 25 | // Function to export the combined CodeSystem resource to a JSON file 26 | isolated function exportCodeSystem(LoincConcept[] concepts, string? 'version, string jsonFilePath) returns error? { 27 | r4:CodeSystem codeSystem; 28 | codeSystem = check createCodeSystemResource(concepts, 'version); 29 | 30 | check io:fileWriteString(jsonFilePath, codeSystem.toJson().toJsonString()); 31 | } 32 | 33 | public isolated function convert(string filePath, string? version) returns error? { 34 | LoincConcept[] loincData = check readLoincCsv(filePath + LOINC_CSV_FILE_PATH); 35 | check exportCodeSystem(loincData, version, filePath + FHIR_LOINC_FILE_NAME); 36 | } 37 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expanded-relationship.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType":"ValueSet", 3 | "meta":{ 4 | "lastUpdated":"2022-05-28T12:47:40.239+10:00", 5 | "profile":["http://hl7.org/fhir/StructureDefinition/shareablevalueset"] 6 | }, 7 | "date":"2022-05-28T12:47:40+10:00", 8 | "copyright":"This is an example set.", 9 | "extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", 10 | "valueCode":"fm"}], 11 | "description":"This value set includes the Patient to subscriber relationship codes.", 12 | "experimental":true, 13 | "title":"Relationship", 14 | "contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"}]}], 15 | "id":"relationship", 16 | "text" : { 17 | "status" : "generated", 18 | "div" : "
" 19 | }, 20 | "identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.3.35"}], 21 | "version":"4.3.0","url":"http://hl7.org/fhir/ValueSet/relationship", 22 | "expansion":{ 23 | "contains":[ 24 | {"code":"1","display":"Self"}, 25 | {"code":"2","display":"Spouse"}], 26 | "total":5, 27 | "offset":0, 28 | "timestamp":"2023-06-28T04:17:01.448894Z" 29 | }, 30 | "immutable":true, 31 | "compose":{ 32 | "include":[{"system":"http://hl7.org/fhir/relationship"}] 33 | }, 34 | "name":"Beneficiary Relationship Codes", 35 | "publisher":"FHIR Project team","status":"draft" 36 | } 37 | -------------------------------------------------------------------------------- /.github/workflows/daily-build.yml: -------------------------------------------------------------------------------- 1 | # This workflow runs daily to build, test, and upload code coverage reports for Ballerina projects to Codecov. 2 | name: Daily build 3 | 4 | on: 5 | schedule: 6 | - cron: '30 18 * * *' # 00:00 in LK time (GMT+5:30) 7 | workflow_dispatch: 8 | 9 | env: 10 | BALLERINA_VERSION: 2201.12.3 11 | 12 | jobs: 13 | build: 14 | name: Build, Test, and Upload Coverage 15 | runs-on: ubuntu-latest 16 | env: 17 | JAVA_OPTS: -Xmx4G 18 | 19 | steps: 20 | - name: Checkout Repository 21 | uses: actions/checkout@v3 22 | 23 | - name: Set Up Ballerina 24 | uses: ballerina-platform/setup-ballerina@v1.1.0 25 | with: 26 | version: $BALLERINA_VERSION 27 | 28 | - name: Build and Test Ballerina Projects 29 | run: | 30 | # Find Ballerina Project Folders 31 | BALLERINA_PROJECT_FOLDERS=$(find . -name "Ballerina.toml" -printf '%p\n' | sed 's/\/Ballerina.toml$//' | sort -u | tr '\n' ' ') 32 | 33 | # Convert BALLERINA_PROJECT_FOLDERS to an array 34 | read -r -a BALLERINA_PROJECTS <<<"${BALLERINA_PROJECT_FOLDERS}" 35 | 36 | # Build and Generate Coverage Report With Ballerina 37 | for folder in "${BALLERINA_PROJECTS[@]}"; do 38 | pushd "$folder" 39 | bal build 40 | bal test --test-report --code-coverage --coverage-format=xml 41 | popd 42 | done 43 | 44 | - name: Upload Coverage Reports to Codecov 45 | uses: codecov/codecov-action@v4.0.1 46 | with: 47 | token: ${{ secrets.CODECOV_TOKEN }} 48 | fail_ci_if_error: true # Optional: Specify if the CI build should fail when Codecov fails. 49 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/utils_generator.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerina/log; 19 | import ballerina/url; 20 | 21 | # Call the discovery endpoint to get the OpenID configuration. 22 | # 23 | # + discoveryEndpoint - Discovery endpoint 24 | # + return - If successful, returns OpenID configuration as a json. Else returns error. 25 | public isolated function getOpenidConfigurations(string discoveryEndpoint) returns OpenIDConfiguration|error { 26 | log:printDebug("Retrieving openid configuration started"); 27 | string discoveryEndpointUrl = check url:decode(discoveryEndpoint, "UTF8"); 28 | http:Client discoveryEpClient = check new (discoveryEndpointUrl.toString()); 29 | OpenIDConfiguration openidConfiguration = check discoveryEpClient -> get("/"); 30 | log:printDebug("Retrieving openid configuration ended"); 31 | return openidConfiguration; 32 | } 33 | 34 | # Pad single digits with a leading zero. 35 | # + number - Number to be padded 36 | # + return - Padded number as a string 37 | isolated function padSingleDigits(int number) returns string { 38 | if (number < 10) { 39 | return "0" + number.toString(); 40 | } 41 | return number.toString(); 42 | } 43 | -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/constants.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | public const CAPABILITY_STATEMENT = "CapabilityStatement"; 18 | public const OPERATION_OUTCOME = "OperationOutcome"; 19 | public const REST_MODE_SERVER = "server"; 20 | public const REST_MODE_CLIENT = "client"; 21 | public const SECURITY_TOKEN = "token"; 22 | public const SECURITY_REVOKE = "revoke"; 23 | public const SECURITY_AUTHORIZE = "authorize"; 24 | public const SECURITY_INTROSPECT = "introspect"; 25 | public const SECURITY_REGISTER = "register"; 26 | public const SECURITY_MANAGE = "manage"; 27 | public const SECURITY_EXT_URL = "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris"; 28 | public const SECURITY_EXT_VALUEURL = "valueUri"; 29 | public const SERVICE_SYSTEM = "http://terminology.hl7.org/CodeSystem/restful-security-service"; 30 | public const SERVICE_CODE = "SMART-on-FHIR"; 31 | public const SERVICE_DISPLAY = "SMART-on-FHIR"; 32 | 33 | public const VALUE_NOT_FOUND = "Value not found"; 34 | public const INTERNAL_SERVER_ERROR = "Internal server error occured"; 35 | public const ERROR_OCCURRED = "Error occurred"; 36 | public const CAPABILITY_STATEMENT_FAILED = "Capability statement generation failed"; 37 | public const CONTACT_SERVER_ADMIN = "Please contact server admin if the issue persists"; 38 | -------------------------------------------------------------------------------- /miscellaneous/validator-service/service_utils.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). 2 | // WSO2 LLC. licenses this file to you under the Apache License, 3 | // Version 2.0 (the "License"); you may not use this file except 4 | // in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, 8 | // software distributed under the License is distributed on an 9 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 10 | // KIND, either express or implied. See the License for the 11 | // specific language governing permissions and limitations 12 | 13 | import ballerinax/health.fhir.r4; 14 | import ballerinax/health.fhir.r4.validator; 15 | 16 | # FHIR validation error details record. 17 | # 18 | # + issues - FHIR issues 19 | public type FHIRValidationErrorDetail record { 20 | *r4:FHIRErrorDetail; 21 | [validator:FHIRValidationIssueDetail, validator:FHIRValidationIssueDetail...] issues; 22 | }; 23 | 24 | # This util function is used to convert FHIR validation error detail to FHIR OperationOutcome issue. 25 | # 26 | # + detail - FHIR validation error detail 27 | # + return - FHIR OperationOutcome issue 28 | isolated function issueDetailToOperationOutcomeIssue(r4:FHIRIssueDetail detail) returns r4:OperationOutcomeIssue { 29 | 30 | r4:OperationOutcomeIssue issueBBE = { 31 | severity: detail.severity, 32 | code: detail.code 33 | }; 34 | 35 | (r4:CodeableConcept)? details = detail.details; 36 | if details != () { 37 | issueBBE.details = details; 38 | } 39 | 40 | string? diagnostic = detail.diagnostic; 41 | if diagnostic != () { 42 | issueBBE.diagnostics = string `${diagnostic}`; 43 | } 44 | 45 | string[]? expression = detail.expression; 46 | if expression != () { 47 | issueBBE.expression = expression; 48 | } 49 | 50 | return issueBBE; 51 | } 52 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/account-status.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType" : "ValueSet", 3 | "id" : "account-status", 4 | "meta" : { 5 | "lastUpdated" : "2019-11-01T09:29:23.356+11:00", 6 | "profile" : ["http://hl7.org/fhir/StructureDefinition/shareablevalueset"] 7 | }, 8 | "text" : { 9 | "status" : "generated", 10 | "div" : "

AccountStatus

Indicates whether the account is available to be used.

\n

This value set includes codes from the following code systems:

" 11 | }, 12 | "extension" : [{ 13 | "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", 14 | "valueCode" : "pa" 15 | }, 16 | { 17 | "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", 18 | "valueCode" : "trial-use" 19 | }, 20 | { 21 | "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", 22 | "valueInteger" : 2 23 | }], 24 | "url" : "http://hl7.org/fhir/ValueSet/account-status", 25 | "identifier" : [{ 26 | "system" : "urn:ietf:rfc:3986", 27 | "value" : "urn:oid:2.16.840.1.113883.4.642.3.726" 28 | }], 29 | "version" : "4.0.1", 30 | "name" : "AccountStatus", 31 | "title" : "AccountStatus", 32 | "status" : "draft", 33 | "experimental" : false, 34 | "date" : "2019-11-01T09:29:23+11:00", 35 | "publisher" : "HL7 (FHIR Project)", 36 | "contact" : [{ 37 | "telecom" : [{ 38 | "system" : "url", 39 | "value" : "http://hl7.org/fhir" 40 | }, 41 | { 42 | "system" : "email", 43 | "value" : "fhir@lists.hl7.org" 44 | }] 45 | }], 46 | "description" : "Indicates whether the account is available to be used.", 47 | "immutable" : true, 48 | "compose" : { 49 | "include" : [{ 50 | "system" : "http://hl7.org/fhir/account-status" 51 | }] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/modules/loinc_to_fhir/types.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | type LoincConcept record { 18 | string LOINC_NUM; 19 | string COMPONENT; 20 | string? PROPERTY?; 21 | string? TIME_ASPCT?; 22 | string? SYSTEM?; 23 | string? SCALE_TYP?; 24 | string? METHOD_TYP?; 25 | string? CLASS?; 26 | string? VersionLastChanged?; 27 | string? CHNG_TYPE?; 28 | string? DefinitionDescription?; 29 | string? STATUS?; 30 | string? CONSUMER_NAME?; 31 | string? CLASSTYPE?; 32 | string? FORMULA?; 33 | string? EXMPL_ANSWERS?; 34 | string? SURVEY_QUEST_TEXT?; 35 | string? SURVEY_QUEST_SRC?; 36 | string? UNITSREQUIRED?; 37 | string? RELATEDNAMES2?; 38 | string? SHORTNAME?; 39 | string? ORDER_OBS?; 40 | string? HL7_FIELD_SUBFIELD_ID?; 41 | string? EXTERNAL_COPYRIGHT_NOTICE?; 42 | string? EXAMPLE_UNITS?; 43 | string? LONG_COMMON_NAME?; 44 | string? EXAMPLE_UCUM_UNITS?; 45 | string? STATUS_REASON?; 46 | string? STATUS_TEXT?; 47 | string? CHANGE_REASON_PUBLIC?; 48 | string? COMMON_TEST_RANK?; 49 | string? COMMON_ORDER_RANK?; 50 | string? HL7_ATTACHMENT_STRUCTURE?; 51 | string? EXTERNAL_COPYRIGHT_LINK?; 52 | string? PanelType?; 53 | string? AskAtOrderEntry?; 54 | string? AssociatedObservations?; 55 | string? VersionFirstReleased?; 56 | string? ValidHL7AttachmentRequest?; 57 | string? DisplayName?; 58 | }; 59 | -------------------------------------------------------------------------------- /miscellaneous/fhirpath-service/service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerinax/health.fhir.r4utils.fhirpath as fhirpath; 19 | 20 | # A service representing a network-accessible API for the fhirpath evaluation. 21 | # Bound to port `9090`. 22 | service / on new http:Listener(9090) { 23 | 24 | # API to evaluate Fhirpath expressions. 25 | # 26 | # + fhirPathRequest - Request for the API 27 | # + return - Result Map of Fhirpath evaluations 28 | isolated resource function post fhirpath (@http:Payload FhirPathRequest fhirPathRequest) returns http:Response { 29 | map outcome = {}; 30 | map fhirResource = fhirPathRequest.fhirResource; 31 | string[]|string fhirPath = fhirPathRequest.fhirPath; 32 | if fhirPath is string[] { 33 | foreach string individualFhirPath in fhirPath { 34 | outcome[individualFhirPath] = fhirpath:getFhirPathResult(fhirResource, individualFhirPath); 35 | } 36 | } else { 37 | outcome[fhirPath] = fhirpath:getFhirPathResult(fhirResource, fhirPath); 38 | } 39 | http:Response response = new; 40 | response.setJsonPayload(outcome.toJson()); 41 | return response; 42 | } 43 | } 44 | 45 | # Record to hold FhirPath request parameters. 46 | # 47 | # + fhirResource - Fhir Resource 48 | # + fhirPath - Fhir Path 49 | public type FhirPathRequest record {| 50 | map fhirResource; 51 | string[]|string fhirPath; 52 | |}; 53 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerina/log; 19 | 20 | // Represents the subtype of http:Ok status code record. 21 | type SmartConfigResponse record {| 22 | *http:Ok; 23 | string mediaType = "application/json"; 24 | json body; 25 | |}; 26 | 27 | // Represents the subtype of http:InternalServerError status code record. 28 | type SmartConfigInternalServerError record {| 29 | *http:InternalServerError; 30 | string body; 31 | |}; 32 | 33 | ## The service representing well known API 34 | final readonly & SmartConfiguration smartConfiguration = check generateSmartConfiguration().cloneReadOnly(); 35 | 36 | # The service representing well known API 37 | # Bound to port defined by configs 38 | service / on new http:Listener(9090) { 39 | 40 | # The authorization endpoints accepted by a FHIR resource server are exposed as a Well-Known Uniform Resource Identifiers (URIs) (RFC5785) JSON document. 41 | # Reference: https://build.fhir.org/ig/HL7/smart-app-launch/conformance.html#using-well-known 42 | # + return - Smart configuration 43 | resource isolated function get fhir/r4/\.well\-known/smart\-configuration() returns SmartConfigResponse|SmartConfigInternalServerError { 44 | json|error response = smartConfiguration.toJson(); 45 | if response is json { 46 | log:printDebug("Smart configuration served successfully."); 47 | return {body: response}; 48 | } 49 | return {body: response.message()}; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expanded-example-valueset-include-concepts.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/ValueSet" 6 | ] 7 | }, 8 | "date": "2025-04-09", 9 | "description": "A ValueSet that includes specific concepts from the same CodeSystem using compose.include.", 10 | "title": "Example ValueSet with Include Concepts", 11 | "contact": [ 12 | { 13 | "name": "Example Team", 14 | "telecom": [ 15 | { 16 | "system": "email", 17 | "value": "support@example.org" 18 | } 19 | ] 20 | } 21 | ], 22 | "id": "example-valueset-include-concepts", 23 | "version": "1.0.0", 24 | "url": "http://example.org/fhir/ValueSet/example-include-concepts", 25 | "expansion": { 26 | "contains": [ 27 | { 28 | "code": "inactive", 29 | "display": "Inactive" 30 | }, 31 | { 32 | "code": "entered-in-error", 33 | "display": "Entered in error" 34 | }, 35 | { 36 | "code": "active", 37 | "display": "Active" 38 | } 39 | ], 40 | "total": 3, 41 | "offset": 0, 42 | "timestamp": "2025-05-26T09:10:29.198583600Z" 43 | }, 44 | "compose": { 45 | "include": [ 46 | { 47 | "system": "http://hl7.org/fhir/account-status", 48 | "concept": [ 49 | { 50 | "code": "active", 51 | "display": "Active" 52 | }, 53 | { 54 | "code": "inactive", 55 | "display": "Inactive" 56 | }, 57 | { 58 | "code": "entered-in-error", 59 | "display": "Entered in Error" 60 | } 61 | ] 62 | } 63 | ] 64 | }, 65 | "name": "ExampleIncludeConcepts", 66 | "publisher": "Example Publisher", 67 | "status": "active" 68 | } -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expanded-example-valueset-include-valueset.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "meta": { 4 | "profile": [ 5 | "http://hl7.org/fhir/StructureDefinition/ValueSet" 6 | ] 7 | }, 8 | "date": "2025-04-09", 9 | "description": "A ValueSet that includes other ValueSets using compose.include.valueSet.", 10 | "title": "Example ValueSet with Include ValueSet", 11 | "contact": [ 12 | { 13 | "name": "Example Team", 14 | "telecom": [ 15 | { 16 | "system": "email", 17 | "value": "support@example.org" 18 | } 19 | ] 20 | } 21 | ], 22 | "id": "example-valueset-include-valueset", 23 | "version": "1.0.0", 24 | "url": "http://example.org/fhir/ValueSet/example-include-valueset", 25 | "expansion": { 26 | "contains": [ 27 | { 28 | "code": "Any", 29 | "display": "Any" 30 | }, 31 | { 32 | "code": "Type", 33 | "display": "Type" 34 | }, 35 | { 36 | "code": "active", 37 | "display": "Active" 38 | }, 39 | { 40 | "code": "on-hold", 41 | "display": "On Hold" 42 | }, 43 | { 44 | "code": "entered-in-error", 45 | "display": "Entered in error" 46 | }, 47 | { 48 | "code": "unknown", 49 | "display": "Unknown" 50 | }, 51 | { 52 | "code": "inactive", 53 | "display": "Inactive" 54 | } 55 | ], 56 | "total": 7, 57 | "offset": 0, 58 | "timestamp": "2025-05-26T09:37:42.277707200Z" 59 | }, 60 | "compose": { 61 | "include": [ 62 | { 63 | "valueSet": [ 64 | "http://hl7.org/fhir/ValueSet/abstract-types", 65 | "http://hl7.org/fhir/ValueSet/account-status" 66 | ] 67 | } 68 | ] 69 | }, 70 | "name": "ExampleIncludeValueSet", 71 | "publisher": "Example Publisher", 72 | "status": "active" 73 | } -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-financial-api-service/enrollment_response_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig enrollmentResponseApiConfig = { 21 | resourceType: "EnrollmentResponse", 22 | profiles: [ 23 | "http://hl7.org/fhir/StructureDefinition/EnrollmentResponse" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "request", 29 | active: true, 30 | information: { 31 | description: "The reference to the claim", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentResponse-request" 34 | } 35 | }, 36 | { 37 | name: "identifier", 38 | active: true, 39 | information: { 40 | description: "The business identifier of the EnrollmentResponse", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentResponse-identifier" 43 | } 44 | }, 45 | { 46 | name: "status", 47 | active: true, 48 | information: { 49 | description: "The status of the enrollment response", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentResponse-status" 52 | } 53 | } 54 | ], 55 | operations: [ 56 | 57 | ], 58 | serverConfig: (), 59 | authzConfig: () 60 | }; 61 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/code_systems/add-valid-codesystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <status value="draft"/> 16 | <experimental value="false"/> 17 | <date value="2020-04-09T21:10:28+00:00"/> 18 | <publisher value="Health Level Seven International"/> 19 | <property> 20 | <code value="status"/> 21 | <uri value="http://hl7.org/fhir/concept-properties#status"/> 22 | <description value="Designation of a concept's state. Normally is not populated unless the state is retired."/> 23 | <type value="code"/> 24 | </property> 25 | 26 | <contact> 27 | <telecom> 28 | <system value="url"/> 29 | <value value="http://hl7.org"/> 30 | </telecom> 31 | <telecom> 32 | <system value="email"/> 33 | <value value="hq@HL7.org"/> 34 | </telecom> 35 | </contact> 36 | <description value="The severity of the adverse event itself, in direct relation to the subject."/> <copyright value="This material derives from the HL7 Terminology (THO). THO is copyright ©1989+ Health Level Seven International and is made available under the CC0 designation. For more licensing information see: https://terminology.hl7.org/license.html"/> 37 | <caseSensitive value="true"/> 38 | <valueSet value="http://terminology.hl7.org/ValueSet/adverse-event-severity"/> 39 | <content value="complete"/> 40 | <filter> 41 | <code value="status"/> 42 | <description value="Filter concepts by their status property (e.g., active, retired)."/> 43 | <operator value="="/> 44 | <value value="active"/> 45 | </filter> 46 | <concept> 47 | <code value="mild"/> 48 | <display value="Mild"/> 49 | </concept> 50 | <concept> 51 | <code value="moderate"/> 52 | <display value="Moderate"/> 53 | </concept> 54 | <concept> 55 | <code value="severe"/> 56 | <display value="Severe"/> 57 | </concept> 58 | </CodeSystem> -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-diagnostics-api-service/README.md: -------------------------------------------------------------------------------- 1 | # Epic FHIR Diagnostics API Service 2 | 3 | This pre-built service provides an API for diagnostics category of Epic FHIR resources. It is built using [Ballerina](https://ballerina.io/) and uses [Epic's FHIR API](https://fhir.epic.com/Documentation) to interact with Epic's electronic health record system. 4 | 5 | ## Prerequisites 6 | 7 | To get started with this service, you'll need to have Ballerina (Refer compatibility to install the relevant version) installed on your machine. If you are trying out with the Epic FHIR Sandbox, you have to create an application and obtain an client key and public key of the Epic FHIR server in order to access their FHIR API. Refer more on app creation on Epic FHIR sandbox [refer](https://fhir.epic.com/Documentation?docId=oauth2§ion=BackendOAuth2Guide). 8 | 9 | ### Setup and run 10 | 11 | 1. Clone this repository to your local machine and navigate to the pre-built service on Epic diagnostics API. 12 | 13 | 2. Set the following values from environment variables. 14 | - `EPIC_FHIR_SERVER_URL` - The URL of the Epic FHIR server. 15 | - `EPIC_FHIR_SERVER_TOKEN_URL` - The URL of the Epic FHIR server token endpoint. 16 | - `EPIC_FHIR_APP_CLIENT_ID` - The client ID of the Epic FHIR application. 17 | - `EPIC_FHIR_APP_PRIVATE_KEY_FILE` - File path for the private key file created for the Epic FHIR application. 18 | 19 | 3. Run the project. 20 | 21 | ```ballerina 22 | bal run 23 | ``` 24 | 25 | 4. Invoke the APIs. 26 | 27 | Sample request for FHIR patient read: 28 | 29 | ``` 30 | curl --location 'localhost:9090/fhir/r4/Patient/erXuFYUfucBZaryVksYEcMg3' 31 | ``` 32 | 33 | ## API Reference 34 | 35 | The following APIs are supported: 36 | 37 | - `/fhir/r4/Observation`: [Observation API](http://hl7.org/fhir/R4/observation.html) : central element in healthcare, used to support diagnosis, monitor progress, determine baselines and patterns and even capture demographic characteristics. 38 | - `/fhir/r4/DiagnosticReport`: [AllergyIntolerance API](http://hl7.org/fhir/R4/diagnosticreport.html) : set of information that is typically provided by a diagnostic service when investigations are complete. The information includes a mix of atomic results, text reports, images, and codes. 39 | 40 | For more information about the data returned by these endpoints, see [Epic's FHIR API documentation](https://fhir.epic.com/Documentation). 41 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/model_openid_configuration.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | # OpenID configuration. 18 | # 19 | # + issuer - issuer 20 | # + authorization_endpoint - authorization endpoint 21 | # + device_authorization_endpoint - device authorization endpoint 22 | # + token_endpoint - token endpoint 23 | # + userinfo_endpoint - userinfo endpoint 24 | # + revocation_endpoint - revocation endpoint 25 | # + introspection_endpoint - introspection endpoint 26 | # + registration_endpoint - registration endpoint 27 | # + management_endpoint - management endpoint 28 | # + jwks_uri - jwks uri 29 | # + grant_types_supported - grant types supported 30 | # + response_types_supported - response types supported 31 | # + subject_types_supported - subject types supported 32 | # + id_token_signing_alg_values_supported - id token signing alg values supported 33 | # + scopes_supported - scopes supported 34 | # + token_endpoint_auth_methods_supported - token endpoint auth methods supported 35 | # + claims_supported - claims supported 36 | # + code_challenge_methods_supported - code challenge methods supported 37 | public type OpenIDConfiguration record { 38 | string issuer?; 39 | string authorization_endpoint?; 40 | string device_authorization_endpoint?; 41 | string token_endpoint?; 42 | string userinfo_endpoint?; 43 | string revocation_endpoint?; 44 | string introspection_endpoint?; 45 | string registration_endpoint?; 46 | string management_endpoint?; 47 | string jwks_uri?; 48 | string[] grant_types_supported?; 49 | string[] response_types_supported?; 50 | string[] subject_types_supported?; 51 | string[] id_token_signing_alg_values_supported?; 52 | string[] scopes_supported?; 53 | string[] token_endpoint_auth_methods_supported?; 54 | string[] claims_supported?; 55 | string[] code_challenge_methods_supported?; 56 | }; 57 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/model_smart_configuration.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | # Smart configuration record 18 | # 19 | # + issuer - Smart configuration issuer 20 | # + jwks_uri - Smart configuration jwks_uri 21 | # + authorization_endpoint - Smart configuration authorization_endpoint 22 | # + grant_types_supported - Smart configuration grant_type_supported 23 | # + token_endpoint - Smart configuration token_endpoint 24 | # + token_endpoint_auth_methods_supported - Smart configuration token_endpoint_auth_methods_supported 25 | # + token_endpoint_auth_signing_alg_values_supported - Smart configuration token endpoint auth signing alg values supported 26 | # + registration_endpoint - Smart configuration registration_endpoint 27 | # + scopes_supported - Smart configuration scopes_supported 28 | # + response_types_supported - Smart configuration response_type_supported 29 | # + management_endpoint - Smart configuration management_endpoint 30 | # + introspection_endpoint - Smart configuration introspection_endpoint 31 | # + revocation_endpoint - Smart configuration revocation_endpoint 32 | # + capabilities - Smart configuration capabilities 33 | # + code_challenge_methods_supported - Smart configuration code_challenge_methods_supported 34 | public type SmartConfiguration record {| 35 | string issuer?; 36 | string jwks_uri?; 37 | string authorization_endpoint; 38 | string[] grant_types_supported; 39 | string token_endpoint; 40 | string[] token_endpoint_auth_methods_supported?; 41 | string[] token_endpoint_auth_signing_alg_values_supported?; 42 | string registration_endpoint?; 43 | string[] scopes_supported?; 44 | string[] response_types_supported?; 45 | string management_endpoint?; 46 | string introspection_endpoint?; 47 | string revocation_endpoint?; 48 | string[] capabilities; 49 | string[] code_challenge_methods_supported; 50 | |}; 51 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-clinical-api-service/allergyintolerance_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig allergyIntoleranceApiConfig = { 21 | resourceType: "AllergyIntolerance", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "clinical-status", 29 | active: true, 30 | information: { 31 | description: "**active | inactive | resolved** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status" 34 | } 35 | }, 36 | { 37 | name: "patient", 38 | active: true, 39 | information: { 40 | description: "**Who the sensitivity is for** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient" 43 | } 44 | } 45 | ], 46 | operations: [ 47 | 48 | ], 49 | serverConfig: (), 50 | authzConfig: () 51 | }; 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open Healthcare Prebuilt Services 2 | ![Daily Build](https://github.com/wso2/open-healthcare-prebuilt-services/actions/workflows/daily-build.yml/badge.svg) 3 | 4 | ## Overview 5 | This repository comprises prebuilt healthcare-related services that are ready for immediate use. Users have the flexibility to deploy and run these services in their respective environments. Optionally, these services can be deployed in [Choreo](https://console.choreo.dev/home) as well. For further details, refer to the documentation of the individual services. 6 | 7 | ## Prerequisite 8 | - Download and install [Ballerina Swan Lake](https://ballerina.io/downloads/) 2202.8.1 or above. 9 | 10 | ## Available Services 11 | ### Conformance 12 | #### [Metadata Service](conformance/metadata-fhirr4-service/) 13 | This service facilitates the exposure of a capability statement describing the current operational functionality of a FHIR server. 14 | 15 | #### [SMART Configuration Service](conformance/smart-config-fhirr4-service/) 16 | This service can be used to expose the discovery document containing authorization endpoint URLs and SMART-features supported by a FHIR server. 17 | 18 | ### Transformation 19 | #### [HL7v2 to FHIR](transformation/v2-to-fhirr4-service/) 20 | Transform HL7v2 messages into FHIR resources using this service. 21 | 22 | #### [CCDA to FHIR](transformation/ccda-to-fhirr4-service/) 23 | This service can be used to transform C-CDA messages into FHIR resources. 24 | 25 | ### EHR Related 26 | #### EPIC Services 27 | These services can be used to integrate with an Epic instance and expose Epic FHIR APIs. 28 | 29 | - [Epic FHIR R4 Administration Service](ehr-connectivity/epic-fhirr4-administration-api-service/) 30 | - [Epic FHIR R4 Clinical Service](ehr-connectivity/epic-fhirr4-clinical-api-service/) 31 | - [Epic FHIR R4 Diagnostics Service](ehr-connectivity/epic-fhirr4-diagnostics-api-service/) 32 | - [Epic FHIR R4 Financial Service](ehr-connectivity/epic-fhirr4-financial-api-service/) 33 | - [Epic FHIR R4 Medications Service](ehr-connectivity/epic-fhirr4-medications-api-service/) 34 | - [Epic FHIR R4 Workflow Service](ehr-connectivity/epic-fhirr4-workflow-api-service/) 35 | 36 | ### Miscellaneous 37 | #### [Authorization Service](miscellaneous/authz-fhirr4-service/) 38 | Apply basic patient and privileged user-based authorization policies for FHIR APIs using this service. 39 | 40 | #### [Audit Service](miscellaneous/audit-service/) 41 | Record audit events upon calling FHIR APIs using this service. 42 | 43 | #### [FHIR Path Service](miscellaneous/fhirpath-service/) 44 | Evaluate FHIR path expressions against a FHIR payload using this service. 45 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-financial-api-service/enrollment_request_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig enrollmentRequestApiConfig = { 21 | resourceType: "EnrollmentRequest", 22 | profiles: [ 23 | "http://hl7.org/fhir/StructureDefinition/EnrollmentRequest" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "patient", 29 | active: true, 30 | information: { 31 | description: "The party to be enrolled", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentRequest-patient" 34 | } 35 | }, 36 | { 37 | name: "status", 38 | active: true, 39 | information: { 40 | description: "The status of the enrollment", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentRequest-status" 43 | } 44 | }, 45 | { 46 | name: "subject", 47 | active: true, 48 | information: { 49 | description: "The party to be enrolled", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentRequest-subject" 52 | } 53 | }, 54 | { 55 | name: "identifier", 56 | active: true, 57 | information: { 58 | description: "The business identifier of the Enrollment", 59 | builtin: false, 60 | documentation: "http://hl7.org/fhir/SearchParameter/EnrollmentRequest-identifier" 61 | } 62 | } 63 | ], 64 | operations: [ 65 | 66 | ], 67 | serverConfig: (), 68 | authzConfig: () 69 | }; 70 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-administration-api-service/practitionerrole_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig practitionerRoleApiConfig = { 21 | resourceType: "PractitionerRole", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "practitioner", 29 | active: true, 30 | information: { 31 | description: "**Practitioner that is able to provide the defined services for the organization** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner" 34 | } 35 | }, 36 | { 37 | name: "specialty", 38 | active: true, 39 | information: { 40 | description: "**The practitioner has this specialty at an organization** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty" 43 | } 44 | } 45 | ], 46 | operations: [ 47 | 48 | ], 49 | serverConfig: () 50 | , 51 | authzConfig: () 52 | }; 53 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/practitionerrole_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig practitionerRoleApiConfig = { 21 | resourceType: "PractitionerRole", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "practitioner", 29 | active: true, 30 | information: { 31 | description: "**Practitioner that is able to provide the defined services for the organization** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner" 34 | } 35 | }, 36 | { 37 | name: "specialty", 38 | active: true, 39 | information: { 40 | description: "**The practitioner has this specialty at an organization** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty" 43 | } 44 | } 45 | ], 46 | operations: [ 47 | 48 | ], 49 | serverConfig: () 50 | , 51 | authzConfig: () 52 | }; 53 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-administration-api-service/organization_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig organizationApiConfig = { 21 | resourceType: "Organization", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "address", 29 | active: true, 30 | information: { 31 | description: "**A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address" 34 | } 35 | }, 36 | { 37 | name: "name", 38 | active: true, 39 | information: { 40 | description: "**A portion of the organization's name or alias** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name" 43 | } 44 | } 45 | ], 46 | operations: [ 47 | 48 | ], 49 | serverConfig: () 50 | , 51 | authzConfig: () 52 | }; 53 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/organization_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig organizationApiConfig = { 21 | resourceType: "Organization", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "address", 29 | active: true, 30 | information: { 31 | description: "**A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address" 34 | } 35 | }, 36 | { 37 | name: "name", 38 | active: true, 39 | information: { 40 | description: "**A portion of the organization's name or alias** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name" 43 | } 44 | } 45 | ], 46 | operations: [ 47 | 48 | ], 49 | serverConfig: () 50 | , 51 | authzConfig: () 52 | }; 53 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | > Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc. 3 | 4 | ## Goals 5 | > Describe the solutions that this feature/fix will introduce to resolve the problems described above 6 | 7 | ## Approach 8 | > Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here. 9 | 10 | ## User stories 11 | > Summary of user stories addressed by this change> 12 | 13 | ## Release note 14 | > Brief description of the new feature or bug fix as it will appear in the release notes 15 | 16 | ## Documentation 17 | > Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact 18 | 19 | ## Training 20 | > Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable 21 | 22 | ## Certification 23 | > Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why. 24 | 25 | ## Marketing 26 | > Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable 27 | 28 | ## Automation tests 29 | - Unit tests 30 | > Code coverage information 31 | - Integration tests 32 | > Details about the test cases and coverage 33 | 34 | ## Security checks 35 | - Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes/no 36 | - Ran FindSecurityBugs plugin and verified report? yes/no 37 | - Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes/no 38 | 39 | ## Samples 40 | > Provide high-level details about the samples related to this feature 41 | 42 | ## Related PRs 43 | > List any other related PRs 44 | 45 | ## Migrations (if applicable) 46 | > Describe migration steps and platforms on which migration has been tested 47 | 48 | ## Test environment 49 | > List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested 50 | 51 | ## Learning 52 | > Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem. -------------------------------------------------------------------------------- /transformation/v2-to-fhirr4-service/service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | // WSO2 LLC. licenses this file to you under the Apache License, 3 | // Version 2.0 (the "License"); you may not use this file except 4 | // in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, 8 | // software distributed under the License is distributed on an 9 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 10 | // KIND, either express or implied. See the License for the 11 | // specific language governing permissions and limitations 12 | // under the License. 13 | import ballerina/http; 14 | import ballerina/log; 15 | import ballerinax/health.fhir.r4; 16 | import ballerinax/health.hl7v2; 17 | import ballerinax/health.hl7v2.utils.v2tofhirr4; 18 | 19 | // Represents the subtype of http:Ok status code record. 20 | type V2ToFhirResponse record {| 21 | *http:Ok; 22 | string mediaType = r4:FHIR_MIME_TYPE_JSON; 23 | json body; 24 | |}; 25 | 26 | // Represents the subtype of http:BadRequest status code record. 27 | type V2ToFhirBadRequest record {| 28 | *http:BadRequest; 29 | string body; 30 | |}; 31 | 32 | // Represents the subtype of http:InternalServerError status code record. 33 | type V2ToFhirInternalServerError record {| 34 | *http:InternalServerError; 35 | string body; 36 | |}; 37 | 38 | // configuration to bind the custom mapping service 39 | configurable v2tofhirr4:V2ToFhirCustomMapperServiceConfig customMapper = { 40 | baseUrl: "", 41 | segmentMappings: {} 42 | }; 43 | 44 | service / on new http:Listener(9090) { 45 | 46 | resource function post transform(@http:Payload string hl7Message) returns V2ToFhirResponse|V2ToFhirBadRequest|V2ToFhirInternalServerError { 47 | json|error v2tofhirResult = v2tofhirr4:v2ToFhir(hl7Message, mapperServiceConf = customMapper); 48 | if v2tofhirResult is json { 49 | log:printDebug("Successfully transformed the HL7 message to FHIR."); 50 | return {body: v2tofhirResult}; 51 | } 52 | else if v2tofhirResult is hl7v2:HL7Error { 53 | string msg = v2tofhirResult.detail().message ?: v2tofhirResult.message(); 54 | log:printError("Failed to transform the HL7 message to FHIR. HL7 message is malformed. Error: ", 'error = v2tofhirResult); 55 | return <V2ToFhirBadRequest>{body: string `HL7 message is malformed. Error: ${msg} .`}; 56 | } 57 | else { 58 | log:printError("Unable to convert HL7 message to FHIR. Error: ", 'error = v2tofhirResult); 59 | return <V2ToFhirInternalServerError>{body: "Unable to convert HL7 message to FHIR."}; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /conformance/smart-config-fhirr4-service/model_config.bal: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 3 | 4 | // WSO2 LLC. licenses this file to you under the Apache License, 5 | // Version 2.0 (the "License"); you may not use this file except 6 | // in compliance with the License. 7 | // You may obtain a copy of the License at 8 | 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | # Smart configuration record 19 | # 20 | # + discoveryEndpoint - Smart configuration discoveryEndpoint 21 | # + smartConfiguration - Smart configuration 22 | public type Configs record {| 23 | string discoveryEndpoint?; 24 | ConfigSmartConfiguration smartConfiguration?; 25 | |}; 26 | 27 | # Smart configuration record 28 | # 29 | # + issuer - Smart configuration issuer 30 | # + jwksUri - Smart configuration jwks_uri 31 | # + authorizationEndpoint - Smart configuration authorization_endpoint 32 | # + grantTypesSupported - Smart configuration grant_type_supported 33 | # + tokenEndpoint - Smart configuration token_endpoint 34 | # + tokenEndpointAuthMethodsSupported - Smart configuration token_endpoint_auth_methods_supported 35 | # + tokenEndpointAuthSigningAlgValuesSupported - Smart configuration token endpoint auth signing alg values supported 36 | # + registrationEndpoint - Smart configuration registration_endpoint 37 | # + scopesSupported - Smart configuration scopes_supported 38 | # + responseTypesSupported - Smart configuration response_type_supported 39 | # + managementEndpoint - Smart configuration management_endpoint 40 | # + introspectionEndpoint - Smart configuration introspection_endpoint 41 | # + revocationEndpoint - Smart configuration revocation_endpoint 42 | # + capabilities - Smart configuration capabilities 43 | # + codeChallengeMethodsSupported - Smart configuration code_challenge_methods_supported 44 | public type ConfigSmartConfiguration record {| 45 | string issuer?; 46 | string jwksUri?; 47 | string authorizationEndpoint?; 48 | string[] grantTypesSupported?; 49 | string tokenEndpoint?; 50 | string[] tokenEndpointAuthMethodsSupported?; 51 | string[] tokenEndpointAuthSigningAlgValuesSupported?; 52 | string registrationEndpoint?; 53 | string[] scopesSupported?; 54 | string[] responseTypesSupported?; 55 | string managementEndpoint?; 56 | string introspectionEndpoint?; 57 | string revocationEndpoint?; 58 | string[] capabilities; 59 | string[] codeChallengeMethodsSupported?; 60 | |}; 61 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expanded-account-status-active-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "meta": { 4 | "lastUpdated": "2019-11-01T09:29:23.356+11:00", 5 | "profile": [ 6 | "http://hl7.org/fhir/StructureDefinition/shareablevalueset" 7 | ] 8 | }, 9 | "date": "2019-11-01T09:29:23+11:00", 10 | "extension": [ 11 | { 12 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", 13 | "valueCode": "pa" 14 | }, 15 | { 16 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", 17 | "valueCode": "trial-use" 18 | }, 19 | { 20 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", 21 | "valueInteger": 2 22 | } 23 | ], 24 | "description": "Indicates whether the account is available to be used.", 25 | "experimental": false, 26 | "title": "AccountStatus", 27 | "contact": [ 28 | { 29 | "telecom": [ 30 | { 31 | "system": "url", 32 | "value": "http://hl7.org/fhir" 33 | }, 34 | { 35 | "system": "email", 36 | "value": "fhir@lists.hl7.org" 37 | } 38 | ] 39 | } 40 | ], 41 | "id": "account-status", 42 | "text": { 43 | "status": "generated", 44 | "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>AccountStatus</h2><div><p>Indicates whether the account is available to be used.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <a href=\"codesystem-account-status.html\"><code>http://hl7.org/fhir/account-status</code></a></li></ul></div>" 45 | }, 46 | "identifier": [ 47 | { 48 | "system": "urn:ietf:rfc:3986", 49 | "value": "urn:oid:2.16.840.1.113883.4.642.3.726" 50 | } 51 | ], 52 | "version": "4.0.1", 53 | "url": "http://hl7.org/fhir/ValueSet/account-status", 54 | "expansion": { 55 | "contains": [ 56 | { 57 | "code": "active", 58 | "display": "Active" 59 | }, 60 | { 61 | "code": "inactive", 62 | "display": "Inactive" 63 | } 64 | ], 65 | "total": 2, 66 | "offset": 0, 67 | "timestamp": "2025-05-26T06:46:23.683611600Z" 68 | }, 69 | "immutable": true, 70 | "compose": { 71 | "include": [ 72 | { 73 | "system": "http://hl7.org/fhir/account-status" 74 | } 75 | ] 76 | }, 77 | "name": "AccountStatus", 78 | "publisher": "HL7 (FHIR Project)", 79 | "status": "draft" 80 | } -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | // WSO2 LLC. licenses this file to you under the Apache License, 3 | // Version 2.0 (the "License"); you may not use this file except 4 | // in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // Unless required by applicable law or agreed to in writing, 8 | // software distributed under the License is distributed on an 9 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 10 | // KIND, either express or implied. See the License for the 11 | // specific language governing permissions and limitations 12 | // under the License. 13 | import ballerina/http; 14 | import ballerina/log; 15 | import ballerinax/health.fhir.r4; 16 | import ballerinax/health.fhir.r4.international401; 17 | import ballerinax/health.fhirr4; 18 | 19 | // Represents the subtype of http:InternalServerError status code record. 20 | type MetatataInternalServerError record {| 21 | *http:InternalServerError; 22 | r4:OperationOutcome body; 23 | |}; 24 | 25 | final r4:ResourceAPIConfig apiConfig = { 26 | resourceType: "OperationOutcome", 27 | profiles: [ 28 | "http://hl7.org/fhir/StructureDefinition/OperationOutcome" 29 | ], 30 | defaultProfile: (), 31 | searchParameters: [], 32 | operations: [], 33 | serverConfig: (), 34 | authzConfig: () 35 | }; 36 | 37 | # # The service representing capability statement API 38 | final readonly & international401:CapabilityStatement capabilityStatement = check generateCapabilityStatement().cloneReadOnly(); 39 | 40 | # The service representing well known API 41 | # Bound to port defined by configs 42 | service / on new fhirr4:Listener(9090, apiConfig) { 43 | 44 | # The capability statement is a key part of the overall conformance framework in FHIR. It is used as a statement of the 45 | # features of actual software, or of a set of rules for an application to provide. This statement connects to all the 46 | # detailed statements of functionality, such as StructureDefinitions and ValueSets. This composite statement of application 47 | # capability may be used for system compatibility testing, code generation, or as the basis for a conformance assessment. 48 | # For further information https://hl7.org/fhir/capabilitystatement.html 49 | # + return - capability statement as a json 50 | isolated resource function get fhir/r4/metadata(r4:FHIRContext fhirContext) returns international401:CapabilityStatement|r4:OperationOutcome { 51 | international401:CapabilityStatement|error response = capabilityStatement; 52 | if response is international401:CapabilityStatement { 53 | log:printDebug("Capability statement served successfully."); 54 | return response; 55 | } 56 | return r4:handleErrorResponse(response); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/query_builder.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | import ballerina/sql; 17 | import ballerinax/persist.sql as psql; 18 | 19 | type SQLSyntax record {| 20 | psql:DataSourceSpecifics dataspecifics; 21 | string regexOperator; 22 | |}; 23 | 24 | isolated SQLSyntax syntax = initializeDataSourceSpecs(); 25 | 26 | isolated function initializeDataSourceSpecs() returns SQLSyntax { 27 | match db_type { 28 | "mysql" => { 29 | return { 30 | dataspecifics: psql:MYSQL_SPECIFICS, 31 | regexOperator: " REGEXP " 32 | }; 33 | } 34 | "postgresql" => { 35 | return { 36 | dataspecifics: psql:POSTGRESQL_SPECIFICS, 37 | regexOperator: " ~ " 38 | }; 39 | } 40 | "mssql" => { 41 | return { 42 | dataspecifics: psql:MSSQL_SPECIFICS, 43 | regexOperator: " LIKE " 44 | }; 45 | } 46 | "h2" => { 47 | return { 48 | dataspecifics: psql:H2_SPECIFICS, 49 | regexOperator: " REGEXP " 50 | }; 51 | } 52 | _ => { 53 | return { 54 | dataspecifics: psql:POSTGRESQL_SPECIFICS, 55 | regexOperator: " ~ " 56 | }; 57 | } 58 | } 59 | } 60 | 61 | isolated function escape(string value) returns string { 62 | lock { 63 | return syntax.dataspecifics.quoteOpen + value + syntax.dataspecifics.quoteClose; 64 | } 65 | } 66 | 67 | isolated function escapeToQuery(string value) returns sql:ParameterizedQuery { 68 | lock { 69 | string escapedValue = escape(value); 70 | return stringToParameterizedQuery(escapedValue); 71 | } 72 | } 73 | 74 | isolated function getRegexOperator() returns sql:ParameterizedQuery { 75 | lock { 76 | return stringToParameterizedQuery(syntax.regexOperator); 77 | } 78 | } 79 | 80 | isolated function getLimitClause(int count, int offset) returns sql:ParameterizedQuery { 81 | if db_type == "mssql" { 82 | return `OFFSET ${offset} ROWS FETCH NEXT ${count} ROWS ONLY`; 83 | } else { 84 | return `LIMIT ${count} OFFSET ${offset}`; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /miscellaneous/validator-service/README.md: -------------------------------------------------------------------------------- 1 | # FHIR Validation API Service 2 | 3 | This service is a Ballerina-based API designed to validate FHIR (Fast Healthcare Interoperability Resources) messages. It uses the ballerinax/health.fhir.r4 and ballerinax/health.fhir.r4.validator libraries for FHIR R4 validation. 4 | 5 | ## Prerequisites 6 | To get started with this service, you'll need to have Ballerina (Refer compatibility to install the relevant version) installed on your machine. 7 | 8 | ### Setup and run 9 | 10 | 1. Clone this repository to your local machine and navigate to the validator-service directory. 11 | 12 | 2. Set the following values from environment variables. 13 | 14 | - `CORS_ALLOWED_ORIGINS` - An array of strings, where each string is a URL that is allowed to access the API (To allow your URL to access the pre-built service, include it in this array). 15 | 16 | 3. (Optional) To enable FHIR terminology validation, create a `Config.toml` file in the project root directory and set the following configuration as shown below: 17 | 18 | ```toml 19 | [ballerinax.health.fhir.r4.validator.terminologyConfig] 20 | isTerminologyValidationEnabled=true # Enable terminology validation, set to false to disable 21 | terminologyServiceApi="http://localhost:9089/fhir/r4" # The base URL of your FHIR R4 terminology service used for validation (update this to match your service endpoint) 22 | tokenUrl="" # Replace with the your token URL 23 | clientId="" # Replace with the your client ID 24 | clientSecret="" # Replace with the your client secret 25 | ``` 26 | 27 | 4. Run the project. 28 | 29 | ```ballerina 30 | bal run 31 | ``` 32 | 33 | 5. Invoke the APIs. 34 | 35 | Sample request for FHIR patient read: 36 | 37 | ```bash 38 | curl -X POST -H "Content-Type: application/json" -d '{ 39 | "resourceType": "Patient", 40 | "id": "example", 41 | "text": { 42 | "status": "generated", 43 | "div": "" 44 | }, 45 | }' http://localhost:9090/validate 46 | ``` 47 | 48 | ## API Reference 49 | 50 | #### POST /validate 51 | 52 | This endpoint accepts a JSON payload containing a FHIR message and validates it. 53 | 54 | #### Request 55 | 56 | The request body should contain a JSON representation of a FHIR message. 57 | 58 | #### Response 59 | 60 | The HTTP status code of the response will be 200 if the validation is successful, and 400 if it fails. 61 | 62 | The response will be a JSON representation of an `OperationOutcome` FHIR resource. This resource contains a list of issues that were found during the validation process. 63 | 64 | If the validation is successful, the `OperationOutcome` will contain a single issue with severity "information" and code "informational", and a diagnostic message "Validation Successful". 65 | 66 | If the validation fails, the `OperationOutcome` will contain one or more issues detailing the validation errors. 67 | -------------------------------------------------------------------------------- /transformation/ccda-to-fhirr4-service/tests/service_test.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/io; 18 | import ballerina/http; 19 | import ballerina/test; 20 | 21 | http:Client testClient = check new ("http://localhost:9090"); 22 | map<string> documentMap = {}; 23 | json bundle = {}; 24 | 25 | @test:BeforeSuite 26 | function beforeSuiteFunc() returns error? { 27 | documentMap["validCcda"] = check io:fileReadString("tests/test_valid_ccda_document.xml"); 28 | documentMap["invalid"] = check io:fileReadString("tests/test_invalid_ccda_document.xml"); 29 | bundle = check io:fileReadJson("tests/test_valid_fhir_bundle.json"); 30 | } 31 | 32 | @test:Config {} 33 | function testCcdaDocumentToFhir() returns error? { 34 | http:Response|error response = testClient->/transform.post(documentMap["validCcda"]); 35 | test:assertTrue(response is http:Response, "Error occurred while transforming CCDA document to FHIR!"); 36 | if (response is http:Response) { 37 | json jsonPayload = check response.getJsonPayload(); 38 | json entryArr = check jsonPayload.entry; 39 | json expectedEntryArr = check bundle.entry; 40 | if entryArr is json[] && expectedEntryArr is json[] { 41 | test:assertEquals(jsonPayload.resourceType, "Bundle", "Response should be a Bundle!"); 42 | test:assertEquals(entryArr.length(), expectedEntryArr.length(), "Response payload length mismatched!"); 43 | } else { 44 | test:assertTrue(false, "Response payload is not an array!"); 45 | } 46 | } 47 | } 48 | 49 | @test:Config {} 50 | function testErrorneousCcdaDocument() returns error? { 51 | http:Response|error response = testClient->/transform.post(documentMap["invalid"]); 52 | if (response is http:Response) { 53 | test:assertEquals(response.statusCode, 400, "Response status code mismatched!"); 54 | json jsonPayload = check response.getJsonPayload(); 55 | test:assertEquals(jsonPayload.resourceType, "OperationOutcome", "Response should be an OperationOutcome!"); 56 | json[] issues = <json[]>check jsonPayload.issue; 57 | json textElement = check issues[0].details.text; 58 | test:assertTrue(string:startsWith(textElement.toString(), "Invalid xml document."), 59 | "Incorrect error message from the invalid document conversion!"); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/persist/model.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | import ballerina/persist as _; 17 | import ballerinax/persist.sql; 18 | 19 | @sql:Name {value: "codesystems"} 20 | public type CodeSystem record {| 21 | @sql:Generated 22 | readonly int codeSystemId; 23 | string id; 24 | string url; 25 | string version; 26 | string name; 27 | string title; 28 | string status; 29 | string date; 30 | string publisher; 31 | byte[] codeSystem; 32 | Concept[] concepts; 33 | |}; 34 | 35 | @sql:Name {value: "concepts"} 36 | public type Concept record {| 37 | @sql:Generated 38 | readonly int conceptId; 39 | string code; 40 | string? display; 41 | string? definition; 42 | byte[] concept; 43 | int? parentConceptId; 44 | CodeSystem codeSystem; 45 | ValueSetComposeIncludeConcept[] valuesetcomposeincludeconcept; 46 | |}; 47 | 48 | @sql:Name {value: "valuesets"} 49 | public type ValueSet record {| 50 | @sql:Generated 51 | readonly int valueSetId; 52 | string id; 53 | string url; 54 | string version; 55 | string name; 56 | string title; 57 | string status; 58 | string date; 59 | string publisher; 60 | byte[] valueSet; 61 | ValueSetComposeInclude[] composes; 62 | ValueSetComposeIncludeValueSet[] conceptsInValueSetConcepts; 63 | |}; 64 | 65 | @sql:Name {value: "valueset_compose_includes"} 66 | public type ValueSetComposeInclude record {| 67 | @sql:Generated 68 | readonly int valueSetComposeIncludeId; 69 | boolean systemFlag; 70 | boolean valueSetFlag; 71 | boolean conceptFlag; 72 | ValueSet valueSet; 73 | ValueSetComposeIncludeValueSet[] valuesetcomposeincludevalueset; 74 | ValueSetComposeIncludeConcept[] valuesetcomposeincludeconcept; 75 | int? codeSystemId; 76 | |}; 77 | 78 | @sql:Name {value: "valueset_compose_include_value_sets"} 79 | public type ValueSetComposeIncludeValueSet record {| 80 | @sql:Generated 81 | readonly int valueSetComposeIncludeValueSetId; 82 | ValueSetComposeInclude valuesetCompose; 83 | ValueSet valueset; 84 | |}; 85 | 86 | @sql:Name {value: "valueset_compose_include_concepts"} 87 | public type ValueSetComposeIncludeConcept record {| 88 | @sql:Generated 89 | readonly int valueSetComposeIncludeConceptId; 90 | ValueSetComposeInclude valuesetCompose; 91 | Concept concept; 92 | |}; 93 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/account-status-as-parameter.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/Parameters"] 5 | }, 6 | "parameter": [ 7 | { 8 | "name": "coding", 9 | "valueCoding": { 10 | "system": "http://hl7.org/fhir/account-status", 11 | "code": "inactive", 12 | "display": "Inactive" 13 | } 14 | }, 15 | { 16 | "name": "valueSet", 17 | "resource": { 18 | "resourceType": "ValueSet", 19 | "id": "account-status", 20 | "meta": { 21 | "lastUpdated": "2019-11-01T09:29:23.356+11:00", 22 | "profile": [ 23 | "http://hl7.org/fhir/StructureDefinition/shareablevalueset" 24 | ] 25 | }, 26 | "text": { 27 | "status": "generated", 28 | "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>AccountStatus</h2><div><p>Indicates whether the account is available to be used.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <a href=\"codesystem-account-status.html\"><code>http://hl7.org/fhir/account-status</code></a></li></ul></div>" 29 | }, 30 | "extension": [ 31 | { 32 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", 33 | "valueCode": "pa" 34 | }, 35 | { 36 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", 37 | "valueCode": "trial-use" 38 | }, 39 | { 40 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", 41 | "valueInteger": 2 42 | } 43 | ], 44 | "url": "http://hl7.org/fhir/ValueSet/account-status", 45 | "identifier": [ 46 | { 47 | "system": "urn:ietf:rfc:3986", 48 | "value": "urn:oid:2.16.840.1.113883.4.642.3.726" 49 | } 50 | ], 51 | "version": "4.0.1", 52 | "name": "AccountStatus", 53 | "title": "AccountStatus", 54 | "status": "draft", 55 | "experimental": false, 56 | "date": "2019-11-01T09:29:23+11:00", 57 | "publisher": "HL7 (FHIR Project)", 58 | "contact": [ 59 | { 60 | "telecom": [ 61 | { 62 | "system": "url", 63 | "value": "http://hl7.org/fhir" 64 | }, 65 | { 66 | "system": "email", 67 | "value": "fhir@lists.hl7.org" 68 | } 69 | ] 70 | } 71 | ], 72 | "description": "Indicates whether the account is available to be used.", 73 | "immutable": true, 74 | "compose": { 75 | "include": [ 76 | { 77 | "system": "http://hl7.org/fhir/account-status" 78 | } 79 | ] 80 | } 81 | } 82 | } 83 | ] 84 | } 85 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-medications-api-service/immunization_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig immunizationApiConfig = { 21 | resourceType: "Immunization", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "patient", 29 | active: true, 30 | information: { 31 | description: "**The patient for the vaccination record** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient" 34 | } 35 | }, 36 | { 37 | name: "status", 38 | active: true, 39 | information: { 40 | description: "**Immunization event status** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status" 43 | } 44 | }, 45 | { 46 | name: "date", 47 | active: true, 48 | information: { 49 | description: "**Vaccination (non)-Administration Date** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date" 52 | } 53 | } 54 | ], 55 | operations: [ 56 | 57 | ], 58 | serverConfig: (), 59 | authzConfig: () 60 | }; 61 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-clinical-api-service/README.md: -------------------------------------------------------------------------------- 1 | # Epic FHIR Clinical API Service 2 | 3 | This pre-built service provides an API for clinical category of Epic FHIR resources. It is built using [Ballerina](https://ballerina.io/) and uses [Epic's FHIR API](https://fhir.epic.com/Documentation) to interact with Epic's electronic health record system. 4 | 5 | ## Prerequisites 6 | 7 | To get started with this service, you'll need to have Ballerina (Refer compatibility to install the relevant version) installed on your machine. If you are trying out with the Epic FHIR Sandbox, you have to create an application and obtain an client key and public key of the Epic FHIR server in order to access their FHIR API. Refer more on app creation on Epic FHIR sandbox [refer](https://fhir.epic.com/Documentation?docId=oauth2§ion=BackendOAuth2Guide). 8 | 9 | ### Setup and run 10 | 11 | 1. Clone this repository to your local machine and navigate to the pre-built service on Epic clinical API. 12 | 13 | 2. Set the following values from environment variables. 14 | - `EPIC_FHIR_SERVER_URL` - The URL of the Epic FHIR server. 15 | - `EPIC_FHIR_SERVER_TOKEN_URL` - The URL of the Epic FHIR server token endpoint. 16 | - `EPIC_FHIR_APP_CLIENT_ID` - The client ID of the Epic FHIR application. 17 | - `EPIC_FHIR_APP_PRIVATE_KEY_FILE` - File path for the private key file created for the Epic FHIR application. 18 | 19 | 3. Run the project. 20 | 21 | ```ballerina 22 | bal run 23 | ``` 24 | 25 | 4. Invoke the APIs. 26 | 27 | Sample request for FHIR patient read: 28 | 29 | ``` 30 | curl --location 'localhost:9090/fhir/r4/Patient/erXuFYUfucBZaryVksYEcMg3' 31 | ``` 32 | 33 | ## API Reference 34 | 35 | The following APIs are supported: 36 | 37 | - `/fhir/r4/Condition`: [Condition API](http://hl7.org/fhir/us/core/StructureDefinition-us-core-condition-encounter-diagnosis.html|http://hl7.org/fhir/us/core/StructureDefinition-us-core-condition-problems-health-concerns.html) : used to record detailed information about a condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. 38 | - `/fhir/r4/AllergyIntolerance`: [AllergyIntolerance API](http://hl7.org/fhir/us/core/StructureDefinition-us-core-allergyintolerance.html) : A record of a clinical assessment of an allergy or intolerance; a propensity, or a potential risk to an individual, to have an adverse reaction on future exposure to the specified substance, or class of substance. 39 | - `/fhir/r4/Procedure`: [Procedure API](http://hl7.org/fhir/us/core/StructureDefinition-us-core-procedure.html) : used to record the details of current and historical procedures performed on or for a patient. 40 | - `/fhir/r4/ServiceRequest`: [ServiceRequest API](http://hl7.org/fhir/R4/servicerequest.html) : record of a request for a procedure or diagnostic or other service to be planned, proposed, or performed, as distinguished by the ServiceRequest.intent field value, with or on a patient. 41 | 42 | For more information about the data returned by these endpoints, see [Epic's FHIR API documentation](https://fhir.epic.com/Documentation). 43 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/modules/store/script.sql: -------------------------------------------------------------------------------- 1 | -- AUTO-GENERATED FILE. 2 | 3 | -- This file is an auto-generated file by Ballerina persistence layer for model. 4 | -- Please verify the generated scripts and execute them against the target DB server. 5 | 6 | DROP TABLE IF EXISTS "valueset_compose_include_value_sets"; 7 | DROP TABLE IF EXISTS "valueset_compose_include_concepts"; 8 | DROP TABLE IF EXISTS "valueset_compose_includes"; 9 | DROP TABLE IF EXISTS "concepts"; 10 | DROP TABLE IF EXISTS "valuesets"; 11 | DROP TABLE IF EXISTS "codesystems"; 12 | 13 | CREATE TABLE "codesystems" ( 14 | "codeSystemId" SERIAL, 15 | "id" VARCHAR(191) NOT NULL, 16 | "url" VARCHAR(191) NOT NULL, 17 | "version" VARCHAR(191) NOT NULL, 18 | "name" VARCHAR(191) NOT NULL, 19 | "title" VARCHAR(191) NOT NULL, 20 | "status" VARCHAR(191) NOT NULL, 21 | "date" VARCHAR(191) NOT NULL, 22 | "publisher" VARCHAR(191) NOT NULL, 23 | "codeSystem" BYTEA NOT NULL, 24 | PRIMARY KEY("codeSystemId") 25 | ); 26 | 27 | CREATE TABLE "valuesets" ( 28 | "valueSetId" SERIAL, 29 | "id" VARCHAR(191) NOT NULL, 30 | "url" VARCHAR(191) NOT NULL, 31 | "version" VARCHAR(191) NOT NULL, 32 | "name" VARCHAR(191) NOT NULL, 33 | "title" VARCHAR(191) NOT NULL, 34 | "status" VARCHAR(191) NOT NULL, 35 | "date" VARCHAR(191) NOT NULL, 36 | "publisher" VARCHAR(191) NOT NULL, 37 | "valueSet" BYTEA NOT NULL, 38 | PRIMARY KEY("valueSetId") 39 | ); 40 | 41 | CREATE TABLE "concepts" ( 42 | "conceptId" SERIAL, 43 | "code" VARCHAR(191) NOT NULL, 44 | "display" VARCHAR(191), 45 | "definition" VARCHAR(191), 46 | "concept" BYTEA NOT NULL, 47 | "parentConceptId" INT, 48 | "codesystemCodeSystemId" INT NOT NULL, 49 | FOREIGN KEY("codesystemCodeSystemId") REFERENCES "codesystems"("codeSystemId"), 50 | PRIMARY KEY("conceptId") 51 | ); 52 | 53 | CREATE TABLE "valueset_compose_includes" ( 54 | "valueSetComposeIncludeId" SERIAL, 55 | "systemFlag" BOOLEAN NOT NULL, 56 | "valueSetFlag" BOOLEAN NOT NULL, 57 | "conceptFlag" BOOLEAN NOT NULL, 58 | "codeSystemId" INT, 59 | "valuesetValueSetId" INT NOT NULL, 60 | FOREIGN KEY("valuesetValueSetId") REFERENCES "valuesets"("valueSetId"), 61 | PRIMARY KEY("valueSetComposeIncludeId") 62 | ); 63 | 64 | CREATE TABLE "valueset_compose_include_concepts" ( 65 | "valueSetComposeIncludeConceptId" SERIAL, 66 | "valuesetcomposeValueSetComposeIncludeId" INT NOT NULL, 67 | FOREIGN KEY("valuesetcomposeValueSetComposeIncludeId") REFERENCES "valueset_compose_includes"("valueSetComposeIncludeId"), 68 | "conceptConceptId" INT NOT NULL, 69 | FOREIGN KEY("conceptConceptId") REFERENCES "concepts"("conceptId"), 70 | PRIMARY KEY("valueSetComposeIncludeConceptId") 71 | ); 72 | 73 | 74 | CREATE TABLE "valueset_compose_include_value_sets" ( 75 | "valueSetComposeIncludeValueSetId" SERIAL, 76 | "valuesetcomposeValueSetComposeIncludeId" INT NOT NULL, 77 | FOREIGN KEY("valuesetcomposeValueSetComposeIncludeId") REFERENCES "valueset_compose_includes"("valueSetComposeIncludeId"), 78 | "valuesetValueSetId" INT NOT NULL, 79 | FOREIGN KEY("valuesetValueSetId") REFERENCES "valuesets"("valueSetId"), 80 | PRIMARY KEY("valueSetComposeIncludeValueSetId") 81 | ); 82 | 83 | 84 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-medications-api-service/README.md: -------------------------------------------------------------------------------- 1 | # Epic FHIR Medications API Service 2 | 3 | This pre-built service provides an API for medications category of Epic FHIR resources. It is built using [Ballerina](https://ballerina.io/) and uses [Epic's FHIR API](https://fhir.epic.com/Documentation) to interact with Epic's electronic health record system. 4 | 5 | ## Prerequisites 6 | 7 | To get started with this service, you'll need to have Ballerina (Refer compatibility to install the relevant version) installed on your machine. If you are trying out with the Epic FHIR Sandbox, you have to create an application and obtain an client key and public key of the Epic FHIR server in order to access their FHIR API. Refer more on app creation on Epic FHIR sandbox [refer](https://fhir.epic.com/Documentation?docId=oauth2§ion=BackendOAuth2Guide). 8 | 9 | ### Setup and run 10 | 11 | 1. Clone this repository to your local machine and navigate to the pre-built service on Epic medications API. 12 | 13 | 2. Set the following values from environment variables. 14 | - `EPIC_FHIR_SERVER_URL` - The URL of the Epic FHIR server. 15 | - `EPIC_FHIR_SERVER_TOKEN_URL` - The URL of the Epic FHIR server token endpoint. 16 | - `EPIC_FHIR_APP_CLIENT_ID` - The client ID of the Epic FHIR application. 17 | - `EPIC_FHIR_APP_PRIVATE_KEY_FILE` - File path for the private key file created for the Epic FHIR application. 18 | 19 | 3. Run the project. 20 | 21 | ```ballerina 22 | bal run 23 | ``` 24 | 25 | 4. Invoke the APIs. 26 | 27 | Sample request for FHIR patient read: 28 | 29 | ``` 30 | curl --location 'localhost:9090/fhir/r4/Patient/erXuFYUfucBZaryVksYEcMg3' 31 | ``` 32 | 33 | ## API Reference 34 | 35 | The following APIs are supported: 36 | 37 | - `/fhir/r4/Immunization`: [Immunization API](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-immunization.html) : covers the recording of current and historical administration of vaccines to patients across all healthcare disciplines in all care settings and all regions. 38 | - `/fhir/r4/Medication`: [Medication API](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-medication.html) : representing medications in the majority of healthcare settings is a matter of identifying an item from a list and then conveying a reference for the item selected either into a patient-related resource or to other applications. 39 | - `/fhir/r4/MedicationRequest`: [MedicationRequest API](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-medicationrequest.html) : covers all type of orders for medications for a patient. This includes inpatient medication orders as well as community orders. 40 | - `/fhir/r4/MedicationStatement`: [MedicationStatement API](https://www.hl7.org/fhir/medicationstatement.html) : record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. 41 | 42 | For more information about the data returned by these endpoints, see [Epic's FHIR API documentation](https://fhir.epic.com/Documentation). 43 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/account-status-as-parameter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Parameters", 3 | "meta": { 4 | "profile": ["http://hl7.org/fhir/StructureDefinition/Parameters"] 5 | }, 6 | "parameter": [ 7 | { 8 | "name": "codeableConcept", 9 | "valueCodeableConcept": { 10 | "coding": [ 11 | { 12 | "system": "http://hl7.org/fhir/account-status", 13 | "code": "inactive", 14 | "display": "Inactive" 15 | } 16 | ], 17 | "text": "In-Active Account Status" 18 | } 19 | }, 20 | { 21 | "name": "valueSet", 22 | "resource": { 23 | "resourceType": "ValueSet", 24 | "id": "account-status", 25 | "meta": { 26 | "lastUpdated": "2019-11-01T09:29:23.356+11:00", 27 | "profile": [ 28 | "http://hl7.org/fhir/StructureDefinition/shareablevalueset" 29 | ] 30 | }, 31 | "text": { 32 | "status": "generated", 33 | "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>AccountStatus</h2><div><p>Indicates whether the account is available to be used.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <a href=\"codesystem-account-status.html\"><code>http://hl7.org/fhir/account-status</code></a></li></ul></div>" 34 | }, 35 | "extension": [ 36 | { 37 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", 38 | "valueCode": "pa" 39 | }, 40 | { 41 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", 42 | "valueCode": "trial-use" 43 | }, 44 | { 45 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", 46 | "valueInteger": 2 47 | } 48 | ], 49 | "url": "http://hl7.org/fhir/ValueSet/account-status", 50 | "identifier": [ 51 | { 52 | "system": "urn:ietf:rfc:3986", 53 | "value": "urn:oid:2.16.840.1.113883.4.642.3.726" 54 | } 55 | ], 56 | "version": "4.0.1", 57 | "name": "AccountStatus", 58 | "title": "AccountStatus", 59 | "status": "draft", 60 | "experimental": false, 61 | "date": "2019-11-01T09:29:23+11:00", 62 | "publisher": "HL7 (FHIR Project)", 63 | "contact": [ 64 | { 65 | "telecom": [ 66 | { 67 | "system": "url", 68 | "value": "http://hl7.org/fhir" 69 | }, 70 | { 71 | "system": "email", 72 | "value": "fhir@lists.hl7.org" 73 | } 74 | ] 75 | } 76 | ], 77 | "description": "Indicates whether the account is available to be used.", 78 | "immutable": true, 79 | "compose": { 80 | "include": [ 81 | { 82 | "system": "http://hl7.org/fhir/account-status" 83 | } 84 | ] 85 | } 86 | } 87 | } 88 | ] 89 | } 90 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/tests/resources/value_sets/expanded-account-status.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "ValueSet", 3 | "meta": { 4 | "lastUpdated": "2019-11-01T09:29:23.356+11:00", 5 | "profile": [ 6 | "http://hl7.org/fhir/StructureDefinition/shareablevalueset" 7 | ] 8 | }, 9 | "date": "2019-11-01T09:29:23+11:00", 10 | "extension": [ 11 | { 12 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", 13 | "valueCode": "pa" 14 | }, 15 | { 16 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", 17 | "valueCode": "trial-use" 18 | }, 19 | { 20 | "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", 21 | "valueInteger": 2 22 | } 23 | ], 24 | "description": "Indicates whether the account is available to be used.", 25 | "experimental": false, 26 | "title": "AccountStatus", 27 | "contact": [ 28 | { 29 | "telecom": [ 30 | { 31 | "system": "url", 32 | "value": "http://hl7.org/fhir" 33 | }, 34 | { 35 | "system": "email", 36 | "value": "fhir@lists.hl7.org" 37 | } 38 | ] 39 | } 40 | ], 41 | "id": "account-status", 42 | "text": { 43 | "status": "generated", 44 | "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>AccountStatus</h2><div><p>Indicates whether the account is available to be used.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <a href=\"codesystem-account-status.html\"><code>http://hl7.org/fhir/account-status</code></a></li></ul></div>" 45 | }, 46 | "identifier": [ 47 | { 48 | "system": "urn:ietf:rfc:3986", 49 | "value": "urn:oid:2.16.840.1.113883.4.642.3.726" 50 | } 51 | ], 52 | "version": "4.0.1", 53 | "url": "http://hl7.org/fhir/ValueSet/account-status", 54 | "immutable": true, 55 | "compose": { 56 | "include": [ 57 | { 58 | "system": "http://hl7.org/fhir/account-status" 59 | } 60 | ] 61 | }, 62 | "name": "AccountStatus", 63 | "publisher": "HL7 (FHIR Project)", 64 | "status": "draft", 65 | "expansion": { 66 | "contains": [ 67 | { 68 | "code": "active", 69 | "display": "Active" 70 | }, 71 | { 72 | "code": "entered-in-error", 73 | "display": "Entered in error" 74 | }, 75 | { 76 | "code": "unknown", 77 | "display": "Unknown" 78 | }, 79 | { 80 | "code": "on-hold", 81 | "display": "On Hold" 82 | }, 83 | { 84 | "code": "inactive", 85 | "display": "Inactive" 86 | } 87 | ], 88 | "total": 5, 89 | "offset": 0, 90 | "timestamp": "2023-07-16T05:20:48.577708Z" 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/practitioner_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | // This software is the property of WSO2 LLC. and its suppliers, if any. 3 | // Dissemination of any information or reproduction of any material contained 4 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 5 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 6 | // For specific language governing the permissions and limitations under 7 | // this license, please see the license as well as any agreement you’ve 8 | // entered into with WSO2 governing the purchase of this software and any 9 | // associated services. 10 | // 11 | // 12 | // AUTO-GENERATED FILE. DO NOT MODIFY. 13 | // 14 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 15 | // Developers are allowed modify this file as per the requirement. 16 | 17 | import ballerinax/health.fhir.r4; 18 | 19 | final r4:ResourceAPIConfig practitionerApiConfig = { 20 | resourceType: "Practitioner", 21 | profiles: [ 22 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" 23 | ], 24 | defaultProfile: (), 25 | searchParameters: [ 26 | { 27 | name: "name", 28 | active: true, 29 | information: { 30 | description: "**A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 31 | builtin: false, 32 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name" 33 | } 34 | }, 35 | { 36 | name: "_id", 37 | active: true, 38 | information: { 39 | description: "**Logical id of this artifact** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 40 | builtin: false, 41 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-id" 42 | } 43 | }, 44 | { 45 | name: "identifier", 46 | active: true, 47 | information: { 48 | description: "**A practitioner's Identifier** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 49 | builtin: false, 50 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier" 51 | } 52 | } 53 | ], 54 | operations: [ 55 | 56 | ], 57 | serverConfig: () 58 | , 59 | authzConfig: () 60 | }; 61 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/relatedperson_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig relatedPersonApiConfig = { 21 | resourceType: "RelatedPerson", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-relatedperson" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "patient", 29 | active: true, 30 | information: { 31 | description: "**The patient this related person is related to** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-relatedperson-patient" 34 | } 35 | }, 36 | { 37 | name: "_id", 38 | active: true, 39 | information: { 40 | description: "**Logical id of this artifact** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-relatedperson-id" 43 | } 44 | }, 45 | { 46 | name: "name", 47 | active: true, 48 | information: { 49 | description: "**A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-relatedperson-name" 52 | } 53 | } 54 | ], 55 | operations: [ 56 | 57 | ], 58 | serverConfig: () 59 | , 60 | authzConfig: () 61 | }; 62 | -------------------------------------------------------------------------------- /ehr-connectivity/cerner-fhirr4-administration-api-service/relatedperson_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig relatedPersonApiConfig = { 21 | resourceType: "RelatedPerson", 22 | profiles: [ 23 | "http://hl7.org/fhir/us/core/StructureDefinition/us-core-relatedperson" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "patient", 29 | active: true, 30 | information: { 31 | description: "**The patient this related person is related to** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-relatedperson-patient" 34 | } 35 | }, 36 | { 37 | name: "_id", 38 | active: true, 39 | information: { 40 | description: "**Logical id of this artifact** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-relatedperson-id" 43 | } 44 | }, 45 | { 46 | name: "name", 47 | active: true, 48 | information: { 49 | description: "**A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text** **NOTE**: This US Core SearchParameter definition extends the usage context of the[Conformance expectation extension](http://hl7.org/fhir/R4/extension-capabilitystatement-expectation.html) - multipleAnd - multipleOr - comparator - modifier - chain", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/us/core/SearchParameter/us-core-relatedperson-name" 52 | } 53 | } 54 | ], 55 | operations: [ 56 | 57 | ], 58 | serverConfig: () 59 | , 60 | authzConfig: () 61 | }; 62 | -------------------------------------------------------------------------------- /transformation/ccda-to-fhirr4-service/README.md: -------------------------------------------------------------------------------- 1 | # C-CDA to FHIR Service 2 | 3 | ## Introduction 4 | 5 | This service transforms C-CDA to FHIR resources. Data transformation conditions are taken from the official C-CDA to FHIR mappings page (http://hl7.org/fhir/us/ccda/2023May/) and based on the feedback received from the users. 6 | 7 | You do not have to write code from scratch but reuse these existing services when implementing your FHIR services. You can deploy the pre-built service on your own environment or deploy on Choreo as a standard Ballerina service. 8 | 9 | ```Supported FHIR version is 4.0.1.``` 10 | 11 | This pre-built service exposes following CCDA-to-FHIR transformations. 12 | 13 | 1) C-CDA Allergy Intolerance Observation to FHIR Allergy Intolerance. 14 | 2) C-CDA Problem observation to FHIR Condition. 15 | 3) C-CDA Results to FHIR Diagnostic Report. 16 | 4) C-CDA Immunization Activity to FHIR Immunization. 17 | 5) C-CDA Medication Activity to FHIR Medication. 18 | 6) C-CDA Patient Role Header to FHIR Patient. 19 | 7) C-CDA Author Header to FHIR Practitioner. 20 | 8) C-CDA Procedure Activity to FHIR Procedure. 21 | 22 | ## Setup and run 23 | 24 | 1.Clone this repository to your local machine and navigate to the pre-built service on `ccda-to-fhirr4-service`. 25 | 26 | 2. Run the project. 27 | 28 | ```ballerina 29 | bal run 30 | ``` 31 | 32 | 4. Invoke the API. 33 | 34 | Sample request format: 35 | 36 | ``` 37 | curl 'http://<host>:<port>/transform' \ 38 | --header 'Content-Type: application/xml' \ 39 | --data-raw '<ClinicalDocument/>' 40 | ``` 41 | 42 | ## [Optional] Deploy in Choreo 43 | 44 | WSO2’s Choreo (https://wso2.com/choreo/) is an internal developer platform that redefines how you create digital experiences. Choreo empowers you to seamlessly design, develop, deploy, and govern your cloud native applications, unlocking innovation while reducing time-to-market. You can deploy the healthcare prebuilt services in Choreo as explained below. 45 | 46 | ### Prerequisites 47 | 48 | If you are signing in to the Choreo Console for the first time, create an organization as follows: 49 | 50 | 1. Go to https://console.choreo.dev/, and sign in using your preferred method. 51 | 2. Enter a unique organization name. For example, Stark Industries. 52 | 3. Read and accept the privacy policy and terms of use. 53 | 4. Click Create. 54 | This creates the organization and opens the Project Home page of the default project created for you. 55 | 56 | ### Steps to Deploy C-CDA to FHIR prebuilt service in Choreo 57 | 1. Create Service Component 58 | * Fork the pre-built Ballerina services repository (https://github.com/wso2/open-healthcare-prebuilt-services) to your Github organization. 59 | * Create a service component pointing to the `ccda-to-fhirr4-service`. Follow the official documentation to create and configure a service: https://wso2.com/choreo/docs/develop-components/develop-services/develop-a-ballerina-rest-api/#step-1-create-a-service-component. 60 | 61 | * Once the component creation is complete, you will see the component overview page. 62 | 63 | 2. Build and Deploy 64 | 65 | Follow the official documentation to deploy the C-CDA to FHIR service to your organization https://wso2.com/choreo/docs/develop-components/develop-services/develop-a-ballerina-rest-api/#step-2-build-and-deploy. -------------------------------------------------------------------------------- /conformance/metadata-fhirr4-service/tests/test_service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerina/test; 19 | import ballerinax/health.fhir.r4; 20 | import ballerinax/health.fhir.r4.international401; 21 | 22 | # A resource for generating capability statement 23 | # + return - capability statement as a json 24 | function testError() returns r4:FHIRError { 25 | error response = error("Test Error"); 26 | return r4:createFHIRError(response.message(), r4:FATAL, r4:TRANSIENT_EXCEPTION, response.detail().toString(), cause = response); 27 | } 28 | 29 | @test:Config {groups: ["Service"]} 30 | function testService() returns error? { 31 | http:Client clientEndpoint = check new ("http://localhost:9090"); 32 | http:Response _ = check clientEndpoint->get("/fhir/r4/metadata"); 33 | } 34 | 35 | @test:Config {groups: ["Service"]} 36 | function testServiceFatalError() returns error? { 37 | http:Client clientEndpoint = check new ("http://localhost:9090"); 38 | json|error response = clientEndpoint->get("/fhir/r4/metadata"); 39 | if response is json { 40 | test:assertTrue(true); 41 | } else { 42 | test:assertTrue(false); 43 | } 44 | } 45 | 46 | @test:Config {groups: ["Service"]} 47 | function testServiceWithSample() returns error? { 48 | international401:CapabilityStatement sampleCapabilityStatement = { 49 | resourceType: CAPABILITY_STATEMENT, 50 | status: "active", 51 | kind: "instance", 52 | fhirVersion: "4.0.1", 53 | date: "23/03/2022", 54 | format: ["json"], 55 | patchFormat: [], 56 | rest: [] 57 | }; 58 | http:Client clientEndpoint = test:mock(http:Client); 59 | test:prepare(clientEndpoint).when("get").thenReturn(sampleCapabilityStatement); 60 | international401:CapabilityStatement response = check clientEndpoint->get("/fhir/r4/metadata"); 61 | test:assertEquals(response, sampleCapabilityStatement); 62 | } 63 | 64 | public function mockGenerateCapabilityStatement() returns international401:CapabilityStatement|error { 65 | international401:CapabilityStatement capabilityStatement = check mockReadFromConfigs(); 66 | return capabilityStatement; 67 | } 68 | 69 | # method to build capability statement from metadata configurables 70 | # + return - capabilitity statement json object 71 | function mockReadFromConfigs() returns international401:CapabilityStatement|error { 72 | return { 73 | resourceType: CAPABILITY_STATEMENT, 74 | status: "active", 75 | kind: "instance", 76 | fhirVersion: "4.0.1", 77 | date: "23/03/2022", 78 | format: [], 79 | patchFormat: [], 80 | rest: [] 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /transformation/ccda-to-fhirr4-service/service.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). 2 | 3 | // WSO2 LLC. licenses this file to you under the Apache License, 4 | // Version 2.0 (the "License"); you may not use this file except 5 | // in compliance with the License. 6 | // You may obtain a copy of the License at 7 | 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | // Unless required by applicable law or agreed to in writing, 11 | // software distributed under the License is distributed on an 12 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | // KIND, either express or implied. See the License for the 14 | // specific language governing permissions and limitations 15 | // under the License. 16 | 17 | import ballerina/http; 18 | import ballerina/log; 19 | import ballerinax/health.fhir.r4; 20 | import ballerinax/health.fhir.r4utils.ccdatofhir; 21 | 22 | // Represents the subtype of http:Ok status code record. 23 | type CcdaToFhirResponse record {| 24 | *http:Ok; 25 | string mediaType = r4:FHIR_MIME_TYPE_JSON; 26 | r4:Bundle body; 27 | |}; 28 | 29 | // Represents the subtype of http:BadRequest status code record. 30 | type CcdaToFhirBadRequest record {| 31 | *http:BadRequest; 32 | r4:OperationOutcome body; 33 | |}; 34 | 35 | // Represents the subtype of http:InternalServerError status code record. 36 | type CcdaToFhirInternalServerError record {| 37 | *http:InternalServerError; 38 | r4:OperationOutcome body; 39 | |}; 40 | 41 | # This service supports transform CCDA documents to FHIR based on the CCDA to FHIR mapping Implementation Guide. 42 | # Link to the IG: http://hl7.org/fhir/us/ccda/2023May/CF-index.html 43 | # The service is exposed at `/transform` path and the service is listening to HTTP requests at port `9090`. 44 | service / on new http:Listener(9090) { 45 | 46 | # CCDA to FHIR transform service 47 | # + return - Transformed FHIR bundle for the given CCDA document. 48 | resource function post transform(http:RequestContext ctx, http:Request request) returns json|error { 49 | 50 | xml|error xmlPayload = request.getXmlPayload(); 51 | if xmlPayload is error { 52 | string diagnosticMsg = xmlPayload.message(); 53 | error? cause = xmlPayload.cause(); 54 | if cause is error { 55 | diagnosticMsg = cause.message(); 56 | } 57 | r4:OperationOutcome operationOutcome = r4:errorToOperationOutcome(r4:createFHIRError( 58 | "Invalid xml document.", r4:CODE_SEVERITY_ERROR, r4:TRANSIENT_EXCEPTION, diagnostic = diagnosticMsg)); 59 | log:printError(string `Invalid xml document.`, diagnosic = diagnosticMsg); 60 | return {body: operationOutcome}.toJson(); 61 | } 62 | // Pass the xml payload to the CCDA to FHIR transform util function in the FHIR R4 utils package. 63 | r4:Bundle|r4:FHIRError ccdaToFhir = ccdatofhir:ccdaToFhir(xmlPayload); 64 | // If the success scenario, return the transformed FHIR bundle. 65 | if ccdaToFhir is r4:Bundle { 66 | log:printDebug(string`Transformed message: ${ccdaToFhir.toJsonString()}`); 67 | return {body: ccdaToFhir}.toJson(); 68 | } 69 | log:printError("Error occurred in CCDA to FHIR transformation.", ccdaToFhir); 70 | return {body: r4:errorToOperationOutcome(ccdaToFhir)}.toJson(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /miscellaneous/terminology-service/README.md: -------------------------------------------------------------------------------- 1 | # Ballerina FHIR Terminology Service 2 | 3 | This project implements a FHIR R4 Terminology Service in Ballerina, providing RESTful APIs for managing and querying FHIR ValueSets and CodeSystems. It is designed to be compatible with HL7 FHIR R4 standards and supports key terminology operations such as expansion, validation, lookup, and subsumption. 4 | 5 | ## Features 6 | 7 | - **ValueSet Operations**: Expand, validate, search, create, and retrieve ValueSets. 8 | - **CodeSystem Operations**: Lookup, subsume, search, create, and retrieve CodeSystems. 9 | - **Batch Validation**: Validate multiple ValueSets in a single request. 10 | - **Upload**: Upload terminology resources in bulk. 11 | - **Find Code**: Search for codes across CodeSystems and ValueSets. 12 | - **FHIR CapabilityStatement**: Exposes service metadata for FHIR clients. 13 | 14 | ## API Endpoints 15 | 16 | The service exposes the following main endpoints under `/fhir/r4`: 17 | 18 | ### ValueSet 19 | 20 | - `GET /ValueSet/$expand` — Expand a ValueSet. 21 | - `POST /ValueSet/$expand` — Expand a ValueSet with a POST body. 22 | - `GET /ValueSet/$validate-code` — Validate a code against a ValueSet. 23 | - `POST /ValueSet/$validate-code` — Validate a code with a POST body. 24 | - `GET /ValueSet/{id}/$expand` — Expand a ValueSet by ID. 25 | - `GET /ValueSet/{id}/$validate-code` — Validate a code by ValueSet ID. 26 | - `GET /ValueSet/{id}` — Retrieve a ValueSet by ID. 27 | - `GET /ValueSet` — Search ValueSets. 28 | - `POST /ValueSet` — Create a new ValueSet. 29 | 30 | ### CodeSystem 31 | 32 | - `GET /CodeSystem/$lookup` — Lookup a code in a CodeSystem. 33 | - `POST /CodeSystem/$lookup` — Lookup with a POST body. 34 | - `GET /CodeSystem/$subsumes` — Test subsumption relationships. 35 | - `POST /CodeSystem/$subsumes` — Test subsumption with a POST body. 36 | - `GET /CodeSystem/{id}/$lookup` — Lookup by CodeSystem ID. 37 | - `GET /CodeSystem/{id}` — Retrieve a CodeSystem by ID. 38 | - `GET /CodeSystem` — Search CodeSystems. 39 | - `POST /CodeSystem` — Create a new CodeSystem. 40 | 41 | ### Other Operations 42 | 43 | - `POST /` — Batch validate ValueSets. 44 | - `POST /$upload` — Upload terminology resources. 45 | - `GET /$find-code` — Find codes. 46 | - `POST /$find-code` — Find codes with a POST body. 47 | - `GET /metadata` — Get the FHIR CapabilityStatement. 48 | 49 | ## Usage 50 | 51 | 1. **Start the Service**: Run the Ballerina service (see below). 52 | 2. **Interact with the API**: Use tools like Postman or curl to send FHIR-compliant requests to the endpoints. 53 | 3. **Test Data**: Sample ValueSets, CodeSystems, and test payloads are available in the `tests/resources` directory. 54 | 55 | ## Running the Service 56 | 57 | Ensure you have [Ballerina](https://ballerina.io/downloads/) installed. Then run: 58 | 59 | ```sh 60 | bal run service.bal 61 | ``` 62 | 63 | The service will start on port `9089` by default. 64 | 65 | ## Project Structure 66 | 67 | - `service.bal` — Main service implementation. 68 | - `types.bal`, `utils.bal`, `data_mapping.bal`, etc. — Supporting modules and utilities. 69 | - `modules/` — Contains submodules for LOINC, SNOMED, and persistence. 70 | - `tests/` — Test cases and sample resources. 71 | 72 | ## References 73 | 74 | - [HL7 FHIR Terminology Service Specification](https://hl7.org/fhir/terminology-service.html) 75 | - [Ballerina FHIR Module](https://central.ballerina.io/ballerinax/health.fhir.r4) 76 | 77 | ## License 78 | 79 | This project is licensed under the Apache License 2.0. 80 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-financial-api-service/vision_prescription_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig visionPrescriptionApiConfig = { 21 | resourceType: "VisionPrescription", 22 | profiles: [ 23 | "http://hl7.org/fhir/StructureDefinition/VisionPrescription" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "identifier", 29 | active: true, 30 | information: { 31 | description: "[VisionPrescription](visionprescription.html): Return prescriptions with this external identifier", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/SearchParameter/clinical-identifier" 34 | } 35 | }, 36 | { 37 | name: "status", 38 | active: true, 39 | information: { 40 | description: "The status of the vision prescription", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/SearchParameter/VisionPrescription-status" 43 | } 44 | }, 45 | { 46 | name: "patient", 47 | active: true, 48 | information: { 49 | description: "[VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/SearchParameter/clinical-patient" 52 | } 53 | }, 54 | { 55 | name: "encounter", 56 | active: true, 57 | information: { 58 | description: "[VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier", 59 | builtin: false, 60 | documentation: "http://hl7.org/fhir/SearchParameter/clinical-encounter" 61 | } 62 | }, 63 | { 64 | name: "datewritten", 65 | active: true, 66 | information: { 67 | description: "Return prescriptions written on this date", 68 | builtin: false, 69 | documentation: "http://hl7.org/fhir/SearchParameter/VisionPrescription-datewritten" 70 | } 71 | }, 72 | { 73 | name: "prescriber", 74 | active: true, 75 | information: { 76 | description: "Who authorized the vision prescription", 77 | builtin: false, 78 | documentation: "http://hl7.org/fhir/SearchParameter/VisionPrescription-prescriber" 79 | } 80 | } 81 | ], 82 | operations: [ 83 | 84 | ], 85 | serverConfig: (), 86 | authzConfig: () 87 | }; 88 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-financial-api-service/payment_notice_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig paymentNoticeApiConfig = { 21 | resourceType: "PaymentNotice", 22 | profiles: [ 23 | "http://hl7.org/fhir/StructureDefinition/PaymentNotice" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "request", 29 | active: true, 30 | information: { 31 | description: "The Claim", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-request" 34 | } 35 | }, 36 | { 37 | name: "payment-status", 38 | active: true, 39 | information: { 40 | description: "The type of payment notice", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-payment-status" 43 | } 44 | }, 45 | { 46 | name: "created", 47 | active: true, 48 | information: { 49 | description: "Creation date fro the notice", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-created" 52 | } 53 | }, 54 | { 55 | name: "provider", 56 | active: true, 57 | information: { 58 | description: "The reference to the provider", 59 | builtin: false, 60 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-provider" 61 | } 62 | }, 63 | { 64 | name: "status", 65 | active: true, 66 | information: { 67 | description: "The status of the payment notice", 68 | builtin: false, 69 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-status" 70 | } 71 | }, 72 | { 73 | name: "identifier", 74 | active: true, 75 | information: { 76 | description: "The business identifier of the notice", 77 | builtin: false, 78 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-identifier" 79 | } 80 | }, 81 | { 82 | name: "response", 83 | active: true, 84 | information: { 85 | description: "The ClaimResponse", 86 | builtin: false, 87 | documentation: "http://hl7.org/fhir/SearchParameter/PaymentNotice-response" 88 | } 89 | } 90 | ], 91 | operations: [ 92 | 93 | ], 94 | serverConfig: (), 95 | authzConfig: () 96 | }; 97 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-workflow-api-service/README.md: -------------------------------------------------------------------------------- 1 | # Epic FHIR Workflow API Service 2 | 3 | This pre-built service provides an API for workflow category of Epic FHIR resources. It is built using [Ballerina](https://ballerina.io/) and uses [Epic's FHIR API](https://fhir.epic.com/Documentation) to interact with Epic's electronic health record system. 4 | 5 | ## Prerequisites 6 | 7 | To get started with this service, you'll need to have Ballerina (Refer compatibility to install the relevant version) installed on your machine. If you are trying out with the Epic FHIR Sandbox, you have to create an application and obtain an client key and public key of the Epic FHIR server in order to access their FHIR API. Refer more on app creation on Epic FHIR sandbox [refer](https://fhir.epic.com/Documentation?docId=oauth2§ion=BackendOAuth2Guide). 8 | 9 | ### Setup and run 10 | 11 | 1. Clone this repository to your local machine and navigate to the pre-built service on Epic workflow API. 12 | 13 | 2. Set the following values from environment variables. 14 | - `EPIC_FHIR_SERVER_URL` - The URL of the Epic FHIR server. 15 | - `EPIC_FHIR_SERVER_TOKEN_URL` - The URL of the Epic FHIR server token endpoint. 16 | - `EPIC_FHIR_APP_CLIENT_ID` - The client ID of the Epic FHIR application. 17 | - `EPIC_FHIR_APP_PRIVATE_KEY_FILE` - File path for the private key file created for the Epic FHIR application. 18 | 19 | 3. Run the project. 20 | 21 | ```ballerina 22 | bal run 23 | ``` 24 | 25 | 4. Invoke the APIs. 26 | 27 | Sample request for FHIR patient read: 28 | 29 | ``` 30 | curl --location 'localhost:9090/fhir/r4/Patient/erXuFYUfucBZaryVksYEcMg3' 31 | ``` 32 | 33 | ## API Reference 34 | 35 | The following APIs are supported: 36 | 37 | - `/fhir/r4/Schedule`: [Schedule API](http://hl7.org/fhir/R4/schedule.html) : provides a container for time-slots that can be booked using an appointment. It provides the window of time (period) that slots are defined for and what type of appointments can be booked. 38 | - `/fhir/r4/Slot`: [Slot API](http://hl7.org/fhir/R4/slot.html) : used to provide time-slots that can be booked using an appointment. They do not provide any information about appointments that are available, just the time, and optionally what the time can be used for. These are effectively spaces of free/busy time. 39 | - `/fhir/r4/Appointment`: [Appointment API](http://hl7.org/fhir/R4/appointment.html) : used to provide information about a planned meeting that may be in the future or past. The resource only describes a single meeting, a series of repeating visits would require multiple appointment resources to be created for each instance. 40 | - `/fhir/r4/AppointmentResponse`: [AppointmentResponse API](http://hl7.org/fhir/R4/appointmentresponse.html) : used to provide information about a planned meeting that may be in the future or past. They may be for a single meeting or for a series of repeating visits. Examples include a scheduled surgery, a follow-up for a clinical visit, a scheduled conference call between clinicians to discuss a case, the reservation of a piece of diagnostic equipment for a particular use, etc. 41 | - `/fhir/r4/ServiceRequest`: [ServiceRequest API](http://hl7.org/fhir/R4/servicerequest.html) : record of a request for a procedure or diagnostic or other service to be planned, proposed, or performed, as distinguished by the ServiceRequest.intent field value, with or on a patient. 42 | 43 | For more information about the data returned by these endpoints, see [Epic's FHIR API documentation](https://fhir.epic.com/Documentation). 44 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-administration-api-service/README.md: -------------------------------------------------------------------------------- 1 | # Epic FHIR Administration API Service 2 | 3 | This pre-built service provides an API for administering Epic FHIR resources. It is built using [Ballerina](https://ballerina.io/) and uses [Epic's FHIR API](https://fhir.epic.com/Documentation) to interact with Epic's electronic health record system. 4 | 5 | ## Prerequisites 6 | 7 | To get started with this service, you'll need to have Ballerina (Refer compatibility to install the relevant version) installed on your machine. If you are trying out with the Epic FHIR Sandbox, you have to create an application and obtain an client key and public key of the Epic FHIR server in order to access their FHIR API. Refer more on app creation on Epic FHIR sandbox [refer](https://fhir.epic.com/Documentation?docId=oauth2§ion=BackendOAuth2Guide). 8 | 9 | ### Setup and run 10 | 11 | 1. Clone this repository to your local machine and navigate to the pre-built service on Epic administration API. 12 | 13 | 2. Set the following values from environment variables. 14 | - `EPIC_FHIR_SERVER_URL` - The URL of the Epic FHIR server. 15 | - `EPIC_FHIR_SERVER_TOKEN_URL` - The URL of the Epic FHIR server token endpoint. 16 | - `EPIC_FHIR_APP_CLIENT_ID` - The client ID of the Epic FHIR application. 17 | - `EPIC_FHIR_APP_PRIVATE_KEY_FILE` - File path for the private key file created for the Epic FHIR application. 18 | 19 | 3. Run the project. 20 | 21 | ```ballerina 22 | bal run 23 | ``` 24 | 25 | 4. Invoke the APIs. 26 | 27 | Sample request for FHIR patient read: 28 | 29 | ``` 30 | curl --location 'localhost:9090/fhir/r4/Patient/erXuFYUfucBZaryVksYEcMg3' 31 | ``` 32 | 33 | ## API Reference 34 | 35 | The following APIs are supported: 36 | 37 | - `/fhir/r4/Patient`: [Patient API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-patient.html) : focuses on the demographic information necessary to support administrative, financial, or logistic purposes. 38 | - `/fhir/r4/Practitioner`: [Practitioner API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-practitioner.html) : covers data about providers of care or other health-related services. 39 | - `/fhir/r4/PractitionerRole`: [PractitionerRole API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-practitionerrole.html) : specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. 40 | - `/fhir/r4/RelatedPerson`: [RelatedPerson API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-relatedperson.html) : holds data on an entity with a personal or professional relationship to the patient. 41 | - `/fhir/r4/Organization`: [Organization API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-organization.html) : formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. 42 | - `/fhir/r4/Location`: [Location API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-location.html) : defines details and position information for a physical place where resources and participants can be found. 43 | - `/fhir/r4/Encounter`: [Encounter API](http://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-encounter.html) : defines the setting where patient care takes place. This includes ambulatory, inpatient, emergency, home health, and virtual encounters. 44 | 45 | For more information about the data returned by these endpoints, see [Epic's FHIR API documentation](https://fhir.epic.com/Documentation). 46 | -------------------------------------------------------------------------------- /ehr-connectivity/epic-fhirr4-workflow-api-service/schedule_api_config.bal: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. 2 | 3 | // This software is the property of WSO2 LLC. and its suppliers, if any. 4 | // Dissemination of any information or reproduction of any material contained 5 | // herein is strictly forbidden, unless permitted by WSO2 in accordance with 6 | // the WSO2 Software License available at: https://wso2.com/licenses/eula/3.2 7 | // For specific language governing the permissions and limitations under 8 | // this license, please see the license as well as any agreement you’ve 9 | // entered into with WSO2 governing the purchase of this software and any 10 | // associated services. 11 | // 12 | // 13 | // AUTO-GENERATED FILE. DO NOT MODIFY. 14 | // 15 | // This file is auto-generated by WSO2 Healthcare Team for managing utility functions. 16 | // Developers are allowed modify this file as per the requirement. 17 | 18 | import ballerinax/health.fhir.r4; 19 | 20 | final r4:ResourceAPIConfig scheduleApiConfig = { 21 | resourceType: "Schedule", 22 | profiles: [ 23 | "http://hl7.org/fhir/StructureDefinition/Schedule" 24 | ], 25 | defaultProfile: (), 26 | searchParameters: [ 27 | { 28 | name: "specialty", 29 | active: true, 30 | information: { 31 | description: "Type of specialty needed", 32 | builtin: false, 33 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-specialty" 34 | } 35 | }, 36 | { 37 | name: "service-type", 38 | active: true, 39 | information: { 40 | description: "The type of appointments that can be booked into associated slot(s)", 41 | builtin: false, 42 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-service-type" 43 | } 44 | }, 45 | { 46 | name: "date", 47 | active: true, 48 | information: { 49 | description: "Search for Schedule resources that have a period that contains this date specified", 50 | builtin: false, 51 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-date" 52 | } 53 | }, 54 | { 55 | name: "actor", 56 | active: true, 57 | information: { 58 | description: "The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for", 59 | builtin: false, 60 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-actor" 61 | } 62 | }, 63 | { 64 | name: "active", 65 | active: true, 66 | information: { 67 | description: "Is the schedule in active use", 68 | builtin: false, 69 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-active" 70 | } 71 | }, 72 | { 73 | name: "identifier", 74 | active: true, 75 | information: { 76 | description: "A Schedule Identifier", 77 | builtin: false, 78 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-identifier" 79 | } 80 | }, 81 | { 82 | name: "service-category", 83 | active: true, 84 | information: { 85 | description: "High-level category", 86 | builtin: false, 87 | documentation: "http://hl7.org/fhir/SearchParameter/Schedule-service-category" 88 | } 89 | } 90 | ], 91 | operations: [ 92 | 93 | ], 94 | serverConfig: (), 95 | authzConfig: () 96 | }; 97 | --------------------------------------------------------------------------------