dde_client 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/services/dde_client/dde_service.rb +11 -10
- data/lib/dde_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9ff81b364e1eb3f676e175b2057e829accbd95f9fe971335f01b0571fca540
|
4
|
+
data.tar.gz: 0b4f7869847ddc8849f57b0168da0b63dd6943ee63c2e5aeb781cd5a0594354f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6fba5260c11ca7655c2a7217ec6a75ade9bb18018af7a3517abd0dd8a321fccf9be1403d151a3e642c930a0aa47a1dd0797f4f3428d78a209c3e2011fb479c9
|
7
|
+
data.tar.gz: 8e3394c08fc5c51ead99425d41e905e044ecf9059dd607c15eee340c5d84a71d744e87218dfc8e04799da1d1c27d52b6e9963ad384717269336711d47438eae3
|
@@ -336,10 +336,11 @@ class DdeClient::DdeService
|
|
336
336
|
private
|
337
337
|
|
338
338
|
def find_remote_patients_by_npid(npid)
|
339
|
-
response,
|
340
|
-
raise DdeError, "Patient search by npid failed: Dde Response => #{response}" unless response.instance_of?(Array)
|
341
|
-
|
339
|
+
response, status = dde_client.post('search_by_npid', npid: npid)
|
342
340
|
response
|
341
|
+
rescue StandardError => e
|
342
|
+
print "Patient search by npid failed: Dde Response (#{status}) => #{e} \n"
|
343
|
+
[]
|
343
344
|
end
|
344
345
|
|
345
346
|
def find_remote_patients_by_name_and_gender(given_name, family_name, gender)
|
@@ -384,7 +385,8 @@ class DdeClient::DdeService
|
|
384
385
|
# whose NPID has changed, we need to find and resolve these local patients.
|
385
386
|
unresolved_patients = find_patients_by_doc_id(patients[:remotes].collect { |remote_patient| remote_patient['doc_id'] })
|
386
387
|
if unresolved_patients.empty?
|
387
|
-
|
388
|
+
patients = { locals: patients[:locals], remotes: patients[:remotes].collect { |patient| localise_remote_patient(patient) } }
|
389
|
+
return patients
|
388
390
|
end
|
389
391
|
|
390
392
|
additional_patients = resolve_patients(local_patients: unresolved_patients, remote_patients: patients[:remotes])
|
@@ -433,8 +435,7 @@ class DdeClient::DdeService
|
|
433
435
|
|
434
436
|
resolved_patients << local_patient
|
435
437
|
end
|
436
|
-
|
437
|
-
if resolved_patients.empty? && (local_patients.size.zero? && remote_patients.size == 1)
|
438
|
+
if resolved_patients.empty? && (local_patients.size.zero? && remote_patients.size == 10)
|
438
439
|
# HACK: Frontenders requested that if only a single patient exists
|
439
440
|
# remotely and locally none exists, the remote patient should be
|
440
441
|
# imported.
|
@@ -485,16 +486,16 @@ class DdeClient::DdeService
|
|
485
486
|
# Converts a remote patient coming from Dde into a structure similar
|
486
487
|
# to that of a local patient
|
487
488
|
def localise_remote_patient(patient)
|
488
|
-
|
489
|
+
{
|
489
490
|
patient_identifiers: localise_remote_patient_identifiers(patient),
|
490
|
-
person:
|
491
|
+
person: {
|
491
492
|
names: localise_remote_patient_names(patient),
|
492
493
|
addresses: localise_remote_patient_addresses(patient),
|
493
494
|
birthdate: patient['birthdate'],
|
494
495
|
birthdate_estimated: patient['birthdate_estimated'],
|
495
496
|
gender: patient['gender']
|
496
|
-
|
497
|
-
|
497
|
+
}
|
498
|
+
}
|
498
499
|
end
|
499
500
|
|
500
501
|
def localise_remote_patient_identifiers(remote_patient)
|
data/lib/dde_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dde_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bryan-mw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|