From 276325f1d3cfee04684e001dc10c96521e834f0a Mon Sep 17 00:00:00 2001 From: slubwama1 Date: Thu, 7 Jul 2022 10:12:59 +0300 Subject: [PATCH] Adding Guide to Creating Sync Fhir Profiles --- .idea/.gitignore | 8 ++++++ .idea/codeStyles/Project.xml | 7 +++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++++ .idea/encodings.xml | 4 +++ .idea/misc.xml | 9 ++++++ .idea/modules.xml | 8 ++++++ .idea/ugandaemr-technicalguide.iml | 9 ++++++ .idea/vcs.xml | 7 +++++ SUMMARY.md | 5 ++-- dataexchnage/syncfhirprofiles.md | 43 ++++++++++++++++++++++++++++ 10 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/ugandaemr-technicalguide.iml create mode 100644 .idea/vcs.xml create mode 100644 dataexchnage/syncfhirprofiles.md diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..919ce1f --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d79bd4e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c2ed832 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/ugandaemr-technicalguide.iml b/.idea/ugandaemr-technicalguide.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/ugandaemr-technicalguide.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..8306744 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/SUMMARY.md b/SUMMARY.md index 527eddb..7585fa4 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -7,5 +7,6 @@ * [Form Development Guidelines](form-management.md) * [Report Development Guidelines](report-development-guidelines.md) * [Extending with a Custom Module](creating-a-custom-module.md) -* [Releasing UgandaEMR](releasing.md) - +* Data Exchange + * [Setting up Sync Fhir Profiles](dataexchnage/syncfhirprofiles.md) +* [Releasing UgandaEMR](releasing.md) \ No newline at end of file diff --git a/dataexchnage/syncfhirprofiles.md b/dataexchnage/syncfhirprofiles.md new file mode 100644 index 0000000..1b2086d --- /dev/null +++ b/dataexchnage/syncfhirprofiles.md @@ -0,0 +1,43 @@ +# Sync FHIR PROFILE SETUP +In order to set up the generic FHIR generator and sender, there are two major things to be done. +1. Creating a SyncFhirProfile. +2. Creating a Scheduler Task + +## Creating a SyncFhir Profile +The following are the steps taken to create a Sync Fhir Profile +1. On UgandaEMR Home Page Go to System Administrator >>>> UgandaemrSync >>>>Sync FHIR Profile. +2. Click on the “Create Button” to create a new Sync FHIR Profile. A popup window will show. . +3. Fill in all the necessary fields listed on the form (Refer to the SyncFHirProfile Model above to understand the different settings and what they mean) +4. Save the Profile. The saved Profile will be shown in the form. +5. Copy the uuid of the Profile. This will be needed in the Creating a Scheduler Task. + +## Creating a Scheduler Task +This is divided into two parts. + +### Creating a Task Class (Development Mode) +1. Create a Class under “org.openmrs.module.ugandaemrsync.tasks” in the UgandaEMRSyncModule. example task name “TBSyncTask.java” Take Note of the Name. You may need to use the name while creating the scheduler. For example “TB Sync” . +2. Extend the Class with class “AbstractTask”. This will require implementing the “execute” method. + + + public void execute() { + UgandaEMRSyncService ugandaEMRSyncService = Context.getService(UgandaEMRSyncService.class); + SyncFhirProfile syncFhirProfile = ugandaEMRSyncService.getSyncFhirProfileByScheduledTaskName("Place Holder Task Name"); + SyncFHIRRecord syncFHIRRecord = new SyncFHIRRecord(); + syncFHIRRecord.generateCaseBasedFHIRResourceBundles(syncFhirProfile); + syncFHIRRecord.sendFhirResourcesTo(syncFhirProfile); + } +3. Copy Code above and paste it in your class. +4. Change the "Place Holder Task Name" to a name that will match your Scheduler task to be created in OpenMRS. for example “TB Sync” + +### Creating Scheduler Task in OpenMRS +In OpenMRS creating a scheduler task see steps below. +1. Go to Legacy System Administration.>>>>Manage Scheduler. This will navigate you to the scheduler task manager. +2. Click on the “Add Task” Link. This will navigate you to the scheduler create the page. +3. Enter a Name that is the same as the placeholder that was replaced in the process of “Creating a Task Class” for example “TB Sync”. +4. Under the “Schedulable Class” field, enter the class reference for example “org.openmrs.module.ugandaemrsync.tasks.TBSyncTask” +5. In the Schedule tab, set time appropriately +Under Properties, add a property with name “syncFhirProfileUUID” and value “uuid of the sync FHIR profile” the one you had to copy. +6. Save the Scheduler. + +**NB:** For redistribution purposes, ensure that your Sync Fhir Profile and the Scheduler are added to the liquibase changeset file for the sync module. +