Closed brightoibe closed 3 years ago
@brightoibe is this not the purpose of INITIAL and UPDATE flag on the current export, if the timestamp is the same, then the patient XML shouldn't have left the emr in the first place
This is to completely eliminate the need to store anything in the global properties. The process will be completly automated. All XML files are exported at every export but only the files with a "change in their timestamp" are consumed by NDR.
Scenerio 1 : 10,000 XML files are exported by the plugin, NDR checks the timestamp property in the container of each XML file before consuming the file, if your timestamp has changed from what it was the last time, your file is elibile for consumption, if your timestamp is still the same from what it was the last time then your file is not eligible for ingestion.
The plugin scans all the tables where a change is likely to occur e.g (patient, person, person_address, patient_program, obs, encounter,etc) and gets the maximum date_created or date_modified across all these tables to create a variable called "change_timestamp" which is stored as the attribute of the container.
This implication of this is that NDR will do a full ingestion of any XML file that is eligible for ingestion discarding any previous record that patient had in the past.
This will solve the problem of constant requests for sites to be droped on NDR and get us to achieveing 100% concurrence between EMR and NDR
this approach will bring new problems
the solution is for the NDR_last_run_date
to not be modified by anyone.
I understand why this is being done today, but we've discussed and will be eliminating the need for that.
Am proposing a new attribute called "change_timestamp" to be added to the container of every patient's xml. NDR maintains a timstamp history of all patients. If the timestamp on your XML is different from the timestamp on NDR, NDR will consume all your records as "INITIAL". But if the timestamp on NDR is the same as the timestamp on the container, it means no change has happend to your record, NDR has no need to even parse your XML. This will improve the speed and efficiency of the NDR as NDR focuses on consuming only "the entire records" of patients where a new encounter has been added or modified.