mirah-ruby 0.2.1 → 0.4.0
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/.circleci/config.yml +25 -8
- data/lib/mirah/client.rb +120 -2
- data/lib/mirah/data/diagnostic_code.rb +26 -0
- data/lib/mirah/data/patient.rb +43 -0
- data/lib/mirah/data/patient_condition.rb +43 -0
- data/lib/mirah/filters/diagnostic_code_filters.rb +16 -0
- data/lib/mirah/filters/patient_condition_filters.rb +12 -0
- data/lib/mirah/graphql/fragments.rb +34 -0
- data/lib/mirah/graphql/mutations.rb +32 -0
- data/lib/mirah/graphql/queries.rb +92 -0
- data/lib/mirah/inputs/diagnostic_code_input.rb +20 -0
- data/lib/mirah/inputs/patient_condition_input.rb +32 -0
- data/lib/mirah/inputs/patient_input.rb +40 -0
- data/lib/mirah/version.rb +1 -1
- data/schema.json +3546 -1623
- metadata +12 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41451cd5cce251f00e1436c8a7aae2140fe8fbc0c34b8a559531684cbc415c10
|
4
|
+
data.tar.gz: 51b5c3d5095058f4da1b2e0ac5fd36f9fcfdf00ac43dba25b499a0254b87b05b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a0f1ccd84d3b52be85a2639127815ee2614f1a629c72f88d2b0e2629989b69112343f49990f732bc346016b79ffbc19c0fc26e208e06a065f2e9fc72321dc05
|
7
|
+
data.tar.gz: a2e0cb5cfb08bb316255ab708c1167d555e29b67cd753ac97a5aca447a640c20f67c497d9a8aa92a1b124045c1957d9420d501ae43a524c425d635ab623baec0
|
data/.circleci/config.yml
CHANGED
@@ -5,15 +5,13 @@ orbs:
|
|
5
5
|
jobs:
|
6
6
|
test24:
|
7
7
|
docker:
|
8
|
-
- image:
|
8
|
+
- image: cimg/ruby:2.4
|
9
9
|
executor: ruby/default
|
10
10
|
steps:
|
11
11
|
- checkout
|
12
12
|
- run:
|
13
13
|
name: Configure Bundler
|
14
14
|
command: |
|
15
|
-
echo 'export BUNDLER_VERSION=1.16.6' >> $BASH_ENV
|
16
|
-
source $BASH_ENV
|
17
15
|
gem install bundler
|
18
16
|
- run:
|
19
17
|
name: Which bundler?
|
@@ -24,15 +22,13 @@ jobs:
|
|
24
22
|
command: bundle exec rake spec
|
25
23
|
test25:
|
26
24
|
docker:
|
27
|
-
- image:
|
25
|
+
- image: cimg/ruby:2.5
|
28
26
|
executor: ruby/default
|
29
27
|
steps:
|
30
28
|
- checkout
|
31
29
|
- run:
|
32
30
|
name: Configure Bundler
|
33
31
|
command: |
|
34
|
-
echo 'export BUNDLER_VERSION=1.16.6' >> $BASH_ENV
|
35
|
-
source $BASH_ENV
|
36
32
|
gem install bundler
|
37
33
|
- run:
|
38
34
|
name: Which bundler?
|
@@ -43,7 +39,7 @@ jobs:
|
|
43
39
|
command: bundle exec rake spec
|
44
40
|
test26:
|
45
41
|
docker:
|
46
|
-
- image:
|
42
|
+
- image: cimg/ruby:2.6
|
47
43
|
executor: ruby/default
|
48
44
|
steps:
|
49
45
|
- checkout
|
@@ -62,7 +58,26 @@ jobs:
|
|
62
58
|
command: bundle exec rake spec
|
63
59
|
test27:
|
64
60
|
docker:
|
65
|
-
- image:
|
61
|
+
- image: cimg/ruby:2.7
|
62
|
+
executor: ruby/default
|
63
|
+
steps:
|
64
|
+
- checkout
|
65
|
+
- run:
|
66
|
+
name: Configure Bundler
|
67
|
+
command: |
|
68
|
+
echo 'export BUNDLER_VERSION=2.1.4' >> $BASH_ENV
|
69
|
+
source $BASH_ENV
|
70
|
+
gem install bundler
|
71
|
+
- run:
|
72
|
+
name: Which bundler?
|
73
|
+
command: bundle -v
|
74
|
+
- ruby/bundle-install
|
75
|
+
- run:
|
76
|
+
name: Tests
|
77
|
+
command: bundle exec rake spec
|
78
|
+
test31:
|
79
|
+
docker:
|
80
|
+
- image: cimg/ruby:3.1.2
|
66
81
|
executor: ruby/default
|
67
82
|
steps:
|
68
83
|
- checkout
|
@@ -81,6 +96,7 @@ jobs:
|
|
81
96
|
command: bundle exec rake spec
|
82
97
|
|
83
98
|
|
99
|
+
|
84
100
|
workflows:
|
85
101
|
version: 2
|
86
102
|
test:
|
@@ -89,5 +105,6 @@ workflows:
|
|
89
105
|
- test25
|
90
106
|
- test26
|
91
107
|
- test27
|
108
|
+
- test31
|
92
109
|
|
93
110
|
|
data/lib/mirah/client.rb
CHANGED
@@ -104,7 +104,8 @@ module Mirah
|
|
104
104
|
# @option input_values [String, nil] :primary_language see {Data::Patient#primary_language}
|
105
105
|
# @option input_values [String, nil] :email see {Data::Patient#email}
|
106
106
|
# @option input_values [String, nil] :phone_number see {Data::Patient#phone_number}
|
107
|
-
# @option input_values [String, nil] :external_managing_organization_id
|
107
|
+
# @option input_values [String, nil] :external_managing_organization_id
|
108
|
+
# see {Data::Patient#external_managing_organization_id}
|
108
109
|
# @return [PushResult<Data::Patient>] the operation result with a patient on success
|
109
110
|
def push_patient(external_id:, **input_values)
|
110
111
|
mutate(Graphql::Mutations::CreateOrUpdatePatientMutation,
|
@@ -301,6 +302,123 @@ module Mirah
|
|
301
302
|
Data::Appointment, 'createOrUpdateAppointment')
|
302
303
|
end
|
303
304
|
|
305
|
+
#################################################################################################################
|
306
|
+
# DIAGNOSTIC CODE METHODS
|
307
|
+
#################################################################################################################
|
308
|
+
|
309
|
+
# Find an diagnostic code by the given Mirah internal UUID. This method should be used if you already know the Mirah
|
310
|
+
# identifier. If you wish to query by your own system identifier, you should use
|
311
|
+
# {#find_diagnostic_code_by_external_id}
|
312
|
+
#
|
313
|
+
# @since 0.4.0
|
314
|
+
# @param id [String] Mirah UUID for the diagnostic code
|
315
|
+
# @return [Data::DiagnosticCode, nil] the code, or nil if the record does not exist.
|
316
|
+
def find_diagnostic_code(id)
|
317
|
+
query_record(Graphql::Queries::DiagnosticCodeIdQuery, id, Data::DiagnosticCode, 'diagnosticCode')
|
318
|
+
end
|
319
|
+
|
320
|
+
# Find a diagnostic code by your external id. This is a convenience method. If you wish to query a list of
|
321
|
+
# codes by external id, please use {Client#query_diagnostic_codes}.
|
322
|
+
#
|
323
|
+
# @since 0.4.0
|
324
|
+
# @param external_id [String] The identifier of the system of record
|
325
|
+
# @return [Data::DiagnosticCode, nil] the code, or nil if the record does not exist.
|
326
|
+
def find_diagnostic_code_by_external_id(external_id)
|
327
|
+
query_record_by_external_id(Graphql::Queries::DiagnosticCodeExternalIdQuery,
|
328
|
+
external_id,
|
329
|
+
Data::DiagnosticCode,
|
330
|
+
'diagnosticCodeExternal')
|
331
|
+
end
|
332
|
+
|
333
|
+
# Query for diagnostic codes. You may specify a set of parameters as defined in
|
334
|
+
# {Mirah::Filters::DiagnosticCodeFilters}.
|
335
|
+
# Results are returned in a paginated format. See {Collection} for how to page results.
|
336
|
+
# @since 0.4.0
|
337
|
+
# @param external_id [Array<String>] See {Mirah::Filters::DiagnosticCodeFilters#external_id}
|
338
|
+
# @param search [Array<String>] See {Mirah::Filters::DiagnosticCodeFilters#search}
|
339
|
+
# @return [Collection<Data::Appointment>] a collection of pageable codes.
|
340
|
+
def query_diagnostic_codes(external_id: nil, search: nil)
|
341
|
+
query_connection(
|
342
|
+
Graphql::Queries::DiagnosticCodeQuery,
|
343
|
+
Filters::DiagnosticCodeFilters.new(external_id: external_id, search: search),
|
344
|
+
Filters::Paging.default,
|
345
|
+
Data::DiagnosticCode,
|
346
|
+
'diagnosticCodes'
|
347
|
+
)
|
348
|
+
end
|
349
|
+
|
350
|
+
# Create or update a diagnosis code. You must specify an external identifier, all other parameters are optional,
|
351
|
+
# but you may receive errors if you attempt to specify too few parameters for an appointment that does not exist.
|
352
|
+
#
|
353
|
+
# @since 0.1.0
|
354
|
+
# @param external_id [String] the external identifier for this code
|
355
|
+
# @option input_values [String, nil] :name see {Data::DiagnosticCode#name}
|
356
|
+
# @option input_values [String, nil] :code see {Data::DiagnosticCode#code}
|
357
|
+
# @return [PushResult<Data::DiagnosticCode>] the operation result with the code on success
|
358
|
+
def push_diagnostic_code(external_id:, **input_values)
|
359
|
+
mutate(Graphql::Mutations::CreateOrUpdateDiagnosticCodeMutation,
|
360
|
+
Inputs::DiagnosticCodeInput.new(input_values.merge(external_id: external_id)),
|
361
|
+
Data::DiagnosticCode, 'createOrUpdateDiagnosticCode')
|
362
|
+
end
|
363
|
+
|
364
|
+
#################################################################################################################
|
365
|
+
# PATIENT CONDITION METHODS
|
366
|
+
#################################################################################################################
|
367
|
+
|
368
|
+
# Find an condition by the given Mirah internal UUID. This method should be used if you already know the Mirah
|
369
|
+
# identifier. If you wish to query by your own system identifier, you should use
|
370
|
+
# {#find_patient_condition_by_external_id}
|
371
|
+
#
|
372
|
+
# @since 0.4.0
|
373
|
+
# @param id [String] Mirah UUID for the condition
|
374
|
+
# @return [Data::PatientCondition, nil] the code, or nil if the record does not exist.
|
375
|
+
def find_patient_condition(id)
|
376
|
+
query_record(Graphql::Queries::PatientConditionIdQuery, id, Data::PatientCondition, 'patientCondition')
|
377
|
+
end
|
378
|
+
|
379
|
+
# Find a condition by your external id. This is a convenience method. If you wish to query a list of
|
380
|
+
# codes by external id, please use {Client#query_patient_conditions}.
|
381
|
+
#
|
382
|
+
# @since 0.4.0
|
383
|
+
# @param external_id [String] The identifier of the system of record
|
384
|
+
# @return [Data::PatientCondition, nil] the code, or nil if the record does not exist.
|
385
|
+
def find_patient_condition_by_external_id(external_id)
|
386
|
+
query_record_by_external_id(Graphql::Queries::PatientConditionExternalIdQuery,
|
387
|
+
external_id,
|
388
|
+
Data::PatientCondition,
|
389
|
+
'patientConditionExternal')
|
390
|
+
end
|
391
|
+
|
392
|
+
# Query for conditions. You may specify a set of parameters as defined in
|
393
|
+
# {Mirah::Filters::PatientConditionFilters}.
|
394
|
+
# Results are returned in a paginated format. See {Collection} for how to page results.
|
395
|
+
# @since 0.4.0
|
396
|
+
# @param external_id [Array<String>] See {Mirah::Filters::PatientConditionFilters#external_id}
|
397
|
+
# @return [Collection<Data::Appointment>] a collection of pageable codes.
|
398
|
+
def query_patient_conditions(external_id: nil)
|
399
|
+
query_connection(
|
400
|
+
Graphql::Queries::PatientConditionQuery,
|
401
|
+
Filters::PatientConditionFilters.new(external_id: external_id),
|
402
|
+
Filters::Paging.default,
|
403
|
+
Data::PatientCondition,
|
404
|
+
'patientConditions'
|
405
|
+
)
|
406
|
+
end
|
407
|
+
|
408
|
+
# Create or update a condition. You must specify an external identifier, all other parameters are optional,
|
409
|
+
# but you may receive errors if you attempt to specify too few parameters for an appointment that does not exist.
|
410
|
+
#
|
411
|
+
# @since 0.1.0
|
412
|
+
# @param external_id [String] the external identifier for this code
|
413
|
+
# @option input_values [String, nil] :name see {Data::PatientCondition#name}
|
414
|
+
# @option input_values [String, nil] :code see {Data::PatientCondition#code}
|
415
|
+
# @return [PushResult<Data::PatientCondition>] the operation result with the code on success
|
416
|
+
def push_patient_condition(external_id:, **input_values)
|
417
|
+
mutate(Graphql::Mutations::CreateOrUpdatePatientConditionMutation,
|
418
|
+
Inputs::PatientConditionInput.new(input_values.merge(external_id: external_id)),
|
419
|
+
Data::PatientCondition, 'createOrUpdatePatientCondition')
|
420
|
+
end
|
421
|
+
|
304
422
|
##################################################################################################################
|
305
423
|
# Internal methods
|
306
424
|
##################################################################################################################
|
@@ -411,7 +529,7 @@ module Mirah
|
|
411
529
|
if response.errors[:data] == ['401 Unauthorized'] # rubocop:disable Style/GuardClause
|
412
530
|
raise Errors::InvalidCredentials, 'The credentials you have supplied are invalid'
|
413
531
|
else
|
414
|
-
raise Errors::ServerError,
|
532
|
+
raise Errors::ServerError, "Unknown error from Mirah server: #{response.errors.values.flatten.join(',')}"
|
415
533
|
end
|
416
534
|
end
|
417
535
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mirah
|
4
|
+
module Data
|
5
|
+
# Diagnostic codes represent ICD10 or other codes that contain information on diagnosis. The Mirah system models
|
6
|
+
# this simply as a code and a name, effectively operating like a tag.
|
7
|
+
# For example, Major Depressive Disorder could be represented with the code F320.
|
8
|
+
class DiagnosticCode < BaseObject
|
9
|
+
# @!attribute [r] id
|
10
|
+
# @return [string] The internal Mirah identifier
|
11
|
+
attribute :id
|
12
|
+
|
13
|
+
# @!attribute [r] external_id
|
14
|
+
# @return [string] The identifier provided by your system
|
15
|
+
attribute :external_id
|
16
|
+
|
17
|
+
# @!attribute [r] name
|
18
|
+
# @return [string] A description of the code, e.g. "Major Depressive Disorder"
|
19
|
+
attribute :name
|
20
|
+
|
21
|
+
# @!attribute [r] code
|
22
|
+
# @return [string] A string representing the code, e.g. "F320"
|
23
|
+
attribute :code
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/mirah/data/patient.rb
CHANGED
@@ -15,12 +15,42 @@ module Mirah
|
|
15
15
|
|
16
16
|
# @!attribute [r] given_name
|
17
17
|
# @return [string] The patient's first or given name
|
18
|
+
# @deprecated use legal_given_name instead
|
18
19
|
attribute :given_name
|
19
20
|
|
21
|
+
# @!attribute [r] legal_given_name
|
22
|
+
# @return [string] The patient's legal first or given name
|
23
|
+
attribute :legal_given_name
|
24
|
+
|
25
|
+
# @!attribute [r] preferred_given_name
|
26
|
+
# @return [string] The patient's preferred first or given name
|
27
|
+
attribute :preferred_given_name
|
28
|
+
|
20
29
|
# @!attribute [r] family_name
|
21
30
|
# @return [string] The patient's last or family name
|
31
|
+
# @deprecated use legal_family_name instead
|
22
32
|
attribute :family_name
|
23
33
|
|
34
|
+
# @!attribute [r] legal_family_name
|
35
|
+
# @return [string] The patient's legal last or family name
|
36
|
+
attribute :legal_family_name
|
37
|
+
|
38
|
+
# @!attribute [r] preferred_family_name
|
39
|
+
# @return [string] The patient's preferred last or family name
|
40
|
+
attribute :preferred_family_name
|
41
|
+
|
42
|
+
# @!attribute [r] legal_name
|
43
|
+
# @return [string] The patient's full legal name.
|
44
|
+
attribute :legal_name
|
45
|
+
|
46
|
+
# @!attribute [r] preferred_name
|
47
|
+
# @return [string] The patient's full preferred name.
|
48
|
+
attribute :preferred_name
|
49
|
+
|
50
|
+
# @!attribute [r] preferred_pronouns
|
51
|
+
# @return [string] The patient's preferred pronouns.
|
52
|
+
attribute :preferred_pronouns
|
53
|
+
|
24
54
|
# @!attribute [r] birth_date
|
25
55
|
# @return [Date] The patient's date of birth.
|
26
56
|
attribute :birth_date, serializer: Serializers::DateSerializer.new
|
@@ -29,6 +59,14 @@ module Mirah
|
|
29
59
|
# @return [string] The patient's gender
|
30
60
|
attribute :gender
|
31
61
|
|
62
|
+
# @!attribute [r] gender_identity
|
63
|
+
# @return [string] The patient's gender identity as free text
|
64
|
+
attribute :gender_identity
|
65
|
+
|
66
|
+
# @!attribute [r] gender_identity_fhir
|
67
|
+
# @return [string] The patient's gender identity as FHIR extension coded.
|
68
|
+
attribute :gender_identity_fhir
|
69
|
+
|
32
70
|
# @!attribute [r] primary_language
|
33
71
|
# @return [string] The patient's primary language
|
34
72
|
attribute :primary_language
|
@@ -42,6 +80,11 @@ module Mirah
|
|
42
80
|
# Please do not use a phone number which corresponds to a landline as text messages will not be received.
|
43
81
|
attribute :phone_number
|
44
82
|
|
83
|
+
# @!attribute [r] timezone
|
84
|
+
# @return [string] The patient's timezone. If not specified, the organization's default will be used. Timezone
|
85
|
+
# should be formatted like: https://en.wikipedia.org/wiki/Tz_database
|
86
|
+
attribute :timezone
|
87
|
+
|
45
88
|
# @!attribute [r] managing_organization_id
|
46
89
|
# @return [string] The internal mirah id of the organization this patient is with
|
47
90
|
attribute :managing_organization_id, path: %w[managingOrganization], target: 'id'
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mirah
|
4
|
+
module Data
|
5
|
+
class PatientCondition < BaseObject
|
6
|
+
# @!attribute [r] id
|
7
|
+
# @return [string] The internal Mirah identifier
|
8
|
+
attribute :id
|
9
|
+
|
10
|
+
# @!attribute [r] external_id
|
11
|
+
# @return [string] The identifier provided by your system
|
12
|
+
attribute :external_id
|
13
|
+
|
14
|
+
# @!attribute [r] status
|
15
|
+
# @return [string] The status of this condition
|
16
|
+
attribute :status
|
17
|
+
|
18
|
+
# @!attribute [r] onset_date
|
19
|
+
# @return [string] The date of onset
|
20
|
+
attribute :onset_date, serializer: Serializers::DateTimeSerializer.new
|
21
|
+
|
22
|
+
# @!attribute [r] abatement_date
|
23
|
+
# @return [string] The date of abatement
|
24
|
+
attribute :abatement_date, serializer: Serializers::DateTimeSerializer.new
|
25
|
+
|
26
|
+
# @!attribute [r] patient_id
|
27
|
+
# @return [string] The internal mirah id of the patient the condition applies to
|
28
|
+
attribute :patient_id, path: %w[patient], target: 'id'
|
29
|
+
|
30
|
+
# @!attribute [r] external_patient_id
|
31
|
+
# @return [string] Your system identifier for the patient the condition applies to
|
32
|
+
attribute :external_patient_id, path: %w[patient], target: 'externalId'
|
33
|
+
|
34
|
+
# @!attribute [r] diagnostic_code_id
|
35
|
+
# @return [string] The internal mirah id of the code the patient has been diagnosed with
|
36
|
+
attribute :diagnostic_code_id, path: %w[diagnosticCode], target: 'id'
|
37
|
+
|
38
|
+
# @!attribute [r] external_diagnostic_code_id
|
39
|
+
# @return [string] Your system identifier for the code the patient has been diagnosed with
|
40
|
+
attribute :external_diagnostic_code_id, path: %w[diagnosticCode], target: 'externalId'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mirah
|
4
|
+
module Filters
|
5
|
+
# Input parameters and filters for queries returning {Data::DiagnosticCode} objects.
|
6
|
+
class DiagnosticCodeFilters < BaseObject
|
7
|
+
# @!attribute [r] external_id
|
8
|
+
# @return [Array<string>] An array of external identifiers to match.
|
9
|
+
attribute :external_id
|
10
|
+
|
11
|
+
# @!attribute [r] search
|
12
|
+
# @return [string] Smart search by name and other fields where appropriate
|
13
|
+
attribute :search
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mirah
|
4
|
+
module Filters
|
5
|
+
# Input parameters and filters for queries returning {Data::PatientCondition} objects.
|
6
|
+
class PatientConditionFilters < BaseObject
|
7
|
+
# @!attribute [r] external_id
|
8
|
+
# @return [Array<string>] An array of external identifiers to match.
|
9
|
+
attribute :external_id
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -24,6 +24,7 @@ module Mirah
|
|
24
24
|
primaryLanguage
|
25
25
|
email
|
26
26
|
phoneNumber
|
27
|
+
timezone
|
27
28
|
managingOrganization {
|
28
29
|
id
|
29
30
|
externalId
|
@@ -106,6 +107,39 @@ module Mirah
|
|
106
107
|
}
|
107
108
|
}
|
108
109
|
GRAPHQL
|
110
|
+
|
111
|
+
DiagnosticCodeFragment = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
112
|
+
fragment on DiagnosticCode {
|
113
|
+
id
|
114
|
+
externalId
|
115
|
+
name
|
116
|
+
code
|
117
|
+
identifier {
|
118
|
+
value
|
119
|
+
}
|
120
|
+
}
|
121
|
+
GRAPHQL
|
122
|
+
|
123
|
+
PatientConditionFragment = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
124
|
+
fragment on PatientCondition {
|
125
|
+
id
|
126
|
+
externalId
|
127
|
+
patient {
|
128
|
+
id
|
129
|
+
externalId
|
130
|
+
}
|
131
|
+
diagnosticCode {
|
132
|
+
id
|
133
|
+
externalId
|
134
|
+
}
|
135
|
+
identifier {
|
136
|
+
value
|
137
|
+
}
|
138
|
+
onsetDate
|
139
|
+
abatementDate
|
140
|
+
status
|
141
|
+
}
|
142
|
+
GRAPHQL
|
109
143
|
end
|
110
144
|
end
|
111
145
|
end
|
@@ -67,6 +67,38 @@ module Mirah
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
GRAPHQL
|
70
|
+
|
71
|
+
# Create or update a diagnostic code
|
72
|
+
CreateOrUpdateDiagnosticCodeMutation = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
73
|
+
mutation($input: CreateOrUpdateDiagnosticCodeInput!) {
|
74
|
+
createOrUpdateDiagnosticCode(input: $input) {
|
75
|
+
status
|
76
|
+
errors {
|
77
|
+
path
|
78
|
+
message
|
79
|
+
}
|
80
|
+
result {
|
81
|
+
...Mirah::Graphql::Fragments::DiagnosticCodeFragment
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
GRAPHQL
|
86
|
+
|
87
|
+
# Create or update a patient condition
|
88
|
+
CreateOrUpdatePatientConditionMutation = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
89
|
+
mutation($input: CreateOrUpdatePatientConditionInput!) {
|
90
|
+
createOrUpdatePatientCondition(input: $input) {
|
91
|
+
status
|
92
|
+
errors {
|
93
|
+
path
|
94
|
+
message
|
95
|
+
}
|
96
|
+
result {
|
97
|
+
...Mirah::Graphql::Fragments::PatientConditionFragment
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
GRAPHQL
|
70
102
|
end
|
71
103
|
end
|
72
104
|
end
|
@@ -191,6 +191,98 @@ module Mirah
|
|
191
191
|
}
|
192
192
|
}
|
193
193
|
GRAPHQL
|
194
|
+
|
195
|
+
#========================================================================
|
196
|
+
# DIAGNOSTIC CODE QUERIES
|
197
|
+
#========================================================================
|
198
|
+
|
199
|
+
DiagnosticCodeQuery = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
200
|
+
query(
|
201
|
+
$first: Int
|
202
|
+
$last: Int
|
203
|
+
$after: String
|
204
|
+
$before: String,
|
205
|
+
$externalId: [String!],
|
206
|
+
$search: String
|
207
|
+
) {
|
208
|
+
diagnosticCodes(
|
209
|
+
first: $first
|
210
|
+
after: $after
|
211
|
+
before: $before
|
212
|
+
last: $last,
|
213
|
+
externalId: $externalId,
|
214
|
+
search: $search
|
215
|
+
) {
|
216
|
+
nodes {
|
217
|
+
...Mirah::Graphql::Fragments::DiagnosticCodeFragment
|
218
|
+
}
|
219
|
+
pageInfo {
|
220
|
+
...Mirah::Graphql::Fragments::PageInfoFragment
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
GRAPHQL
|
225
|
+
|
226
|
+
DiagnosticCodeIdQuery = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
227
|
+
query($id: ID!) {
|
228
|
+
diagnosticCode(id: $id) {
|
229
|
+
...Mirah::Graphql::Fragments::DiagnosticCodeFragment
|
230
|
+
}
|
231
|
+
}
|
232
|
+
GRAPHQL
|
233
|
+
|
234
|
+
DiagnosticCodeExternalIdQuery = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
235
|
+
query($externalId: String!) {
|
236
|
+
diagnosticCodeExternal(externalId: $externalId) {
|
237
|
+
...Mirah::Graphql::Fragments::DiagnosticCodeFragment
|
238
|
+
}
|
239
|
+
}
|
240
|
+
GRAPHQL
|
241
|
+
|
242
|
+
#========================================================================
|
243
|
+
# PATIENT CONDITION QUERIES
|
244
|
+
#========================================================================
|
245
|
+
|
246
|
+
PatientConditionQuery = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
247
|
+
query(
|
248
|
+
$first: Int
|
249
|
+
$last: Int
|
250
|
+
$after: String
|
251
|
+
$before: String,
|
252
|
+
$externalId: [String!]
|
253
|
+
) {
|
254
|
+
patientConditions(
|
255
|
+
first: $first
|
256
|
+
after: $after
|
257
|
+
before: $before
|
258
|
+
last: $last,
|
259
|
+
externalId: $externalId
|
260
|
+
) {
|
261
|
+
nodes {
|
262
|
+
...Mirah::Graphql::Fragments::PatientConditionFragment
|
263
|
+
}
|
264
|
+
pageInfo {
|
265
|
+
...Mirah::Graphql::Fragments::PageInfoFragment
|
266
|
+
}
|
267
|
+
}
|
268
|
+
}
|
269
|
+
GRAPHQL
|
270
|
+
|
271
|
+
PatientConditionIdQuery = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
272
|
+
query($id: ID!) {
|
273
|
+
patientCondition(id: $id) {
|
274
|
+
...Mirah::Graphql::Fragments::PatientConditionFragment
|
275
|
+
}
|
276
|
+
}
|
277
|
+
GRAPHQL
|
278
|
+
|
279
|
+
PatientConditionExternalIdQuery = Graphql::ValidationClient.parse <<-'GRAPHQL'
|
280
|
+
query($externalId: String!) {
|
281
|
+
patientConditionExternal(externalId: $externalId) {
|
282
|
+
...Mirah::Graphql::Fragments::PatientConditionFragment
|
283
|
+
}
|
284
|
+
}
|
285
|
+
GRAPHQL
|
194
286
|
end
|
195
287
|
end
|
196
288
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mirah
|
4
|
+
module Inputs
|
5
|
+
# A set of parameters for updating a {Data::DiagnosticCocde}
|
6
|
+
class DiagnosticCodeInput < BaseInputObject
|
7
|
+
# @!attribute [r] external_id
|
8
|
+
# @return (see Mirah::Data::DiagnosticCode#external_id)
|
9
|
+
input :external_id, required: true
|
10
|
+
|
11
|
+
# @!attribute [r] name
|
12
|
+
# @return (see Mirah::Data::DiagnosticCode#name)
|
13
|
+
input :name, required: false
|
14
|
+
|
15
|
+
# @!attribute [r] name
|
16
|
+
# @return (see Mirah::Data::DiagnosticCode#code)
|
17
|
+
input :code, required: false
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mirah
|
4
|
+
module Inputs
|
5
|
+
# A set of parameters for updating a {Data::Appointment}
|
6
|
+
class PatientConditionInput < BaseInputObject
|
7
|
+
# @!attribute [r] external_id
|
8
|
+
# @return (see Mirah::Data::PatientCondition#external_id)
|
9
|
+
input :external_id, required: true
|
10
|
+
|
11
|
+
# @!attribute [r] onset_date
|
12
|
+
# @return (see Mirah::Data::PatientCondition#onset_date)
|
13
|
+
input :onset_date, required: false, serializer: Serializers::DateTimeSerializer.new
|
14
|
+
|
15
|
+
# @!attribute [r] abatement_date
|
16
|
+
# @return (see Mirah::Data::PatientCondition#abatement_date)
|
17
|
+
input :abatement_date, required: false, serializer: Serializers::DateTimeSerializer.new
|
18
|
+
|
19
|
+
# @!attribute [r] status
|
20
|
+
# @return (see Mirah::Data::PatientCondition#status)
|
21
|
+
input :status, required: true
|
22
|
+
|
23
|
+
# @!attribute [r] external_patient_id
|
24
|
+
# @return (see Mirah::Data::PatientCondition#external_patient_id)
|
25
|
+
input :external_patient_id, required: false
|
26
|
+
|
27
|
+
# @!attribute [r] external_diagnostic_code_id
|
28
|
+
# @return (see Mirah::Data::PatientCondition#external_diagnostic_code_id)
|
29
|
+
input :external_diagnostic_code_id, required: false
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|