Commit 0359427
authored
feat: Surface has_failed_stations in v2 prescriptions response meta (#27043)
* Surface has_failed_stations in v2 prescriptions response meta
PrescriptionsAdapter#parse now always returns a Hash:
{ prescriptions: Array<Prescription>, metadata: Hash }
The metadata hash includes :has_failed_stations (boolean), which is
true when VistA reports a failedStationList or Oracle Health returns
an OperationOutcome with error-severity issues.
Controller changes:
- v2 PrescriptionsController#index merges metadata into response opts
- v2 show/list_refillable_prescriptions extract [:prescriptions]
- Mobile v1 PrescriptionsController extracts [:prescriptions]
Also adds VCR cassette for VistA partial-failure scenario and
updates OpenAPI spec with has_failed_stations in PrescriptionList meta.
* Address Copilot review: align VCR placeholder and improve OpenAPI description
* Fix OpenAPI: make has_failed_stations optional, fix recently_requested type
- Remove has_failed_stations from required array since V1 endpoints
don't include it (only V2 does)
- Change recently_requested items type from string to PrescriptionDetail
ref to match actual response (both V1 and V2 return prescription objects)
* Split PrescriptionList schema into V1/V2-specific schemas
Replace the monolithic PrescriptionList OpenAPI schema with
version-specific definitions that accurately reflect each endpoint:
- V1PrescriptionList: includes updated_at, failed_station_list, and
V1PrescriptionFilterCount (5 status keys)
- V2PrescriptionList: includes has_failed_stations boolean and
V2PrescriptionFilterCount (8 status keys)
- Shared schemas: PrescriptionSortMeta, PaginationMeta, PaginationLinks
- V1 list_refillable: inline schema with updated_at, failed_station_list,
recently_requested (array of PrescriptionDetail)
- V2 list_refillable: fixed recently_requested items type from object
to PrescriptionDetail ref
Addresses Copilot review feedback about V1/V2 meta shape divergence.
* Split OpenAPI PrescriptionList into V1/V2 schemas; fail loud on nil body
- Replace monolithic PrescriptionList.yml with version-specific schemas:
- V1PrescriptionList.yml: updated_at, failed_station_list, 5 filter keys
- V2PrescriptionList.yml: has_failed_stations boolean, 8 filter keys
- Update openapi.yaml route refs to use V1/V2 schemas
- Regenerate openapi_merged.yaml via redocly bundle
- Change nil body guard from silent empty return to ArgumentError
- Update specs to expect ArgumentError on nil input
* Address review: fix misleading spec name, align VCR placeholder
* Align oracle_health_failed? with OperationOutcomeDetector::ERROR_SEVERITIES1 parent 537e557 commit 0359427
File tree
16 files changed
+750
-218
lines changed- lib/unified_health_data
- adapters
- modules
- mobile
- app/controllers/mobile/v1
- spec/requests/mobile/v1/health
- my_health
- app/controllers/my_health/v2
- docs
- schemas
- spec/requests/my_health/v2
- spec
- lib/unified_health_data
- adapters
- support/vcr_cassettes/unified_health_data
16 files changed
+750
-218
lines changedLines changed: 40 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | | - | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
129 | 167 | | |
130 | 168 | | |
131 | 169 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | | - | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | | - | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1870 | 1870 | | |
1871 | 1871 | | |
1872 | 1872 | | |
1873 | | - | |
| 1873 | + | |
1874 | 1874 | | |
1875 | 1875 | | |
1876 | 1876 | | |
| |||
1956 | 1956 | | |
1957 | 1957 | | |
1958 | 1958 | | |
1959 | | - | |
| 1959 | + | |
1960 | 1960 | | |
1961 | 1961 | | |
1962 | 1962 | | |
| |||
2283 | 2283 | | |
2284 | 2284 | | |
2285 | 2285 | | |
2286 | | - | |
| 2286 | + | |
2287 | 2287 | | |
2288 | 2288 | | |
2289 | 2289 | | |
| |||
0 commit comments