Advertisement
hasancse1991

Untitled

Mar 24th, 2020
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.36 KB | None | 0 0
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "definitions": {
  4. "patient_event": {
  5. "type": "object",
  6. "properties": {
  7. "timeline_item_type": {
  8. "const": "patient_event"
  9. },
  10. "id": {
  11. "type": "integer"
  12. },
  13. "title": {
  14. "type": [
  15. "string",
  16. "null"
  17. ]
  18. },
  19. "description": {
  20. "type": [
  21. "string",
  22. "null"
  23. ]
  24. },
  25. "icon": {
  26. "type": [
  27. "string",
  28. "null"
  29. ],
  30. "title": "Name of an icon from Bootstrap/Glyphicons icon set.",
  31. "description": "available icons: https://glyphicons.bootstrapcheatsheets.com/",
  32. "examples": [
  33. "scale",
  34. "facetime-video",
  35. "exclaimation-sign"
  36. ],
  37. "pattern": "^[a-z\\-]+$"
  38. },
  39. "type_key": {
  40. "type": [
  41. "string",
  42. "null"
  43. ],
  44. "title": "An enum-like string that indicates special type of patient event.",
  45. "examples": [
  46. "patient_event_type/operation",
  47. "patient_event_type/hospitalization",
  48. "patient_event_type/doctor_visit"
  49. ],
  50. "pattern": "^patient_event_type/[A-Za-z0-9_]+$"
  51. },
  52. "start_date": {
  53. "type": "string",
  54. "format": "date-time",
  55. "title": "Start date+time of patient event",
  56. "description": "e.g.: your doctor visit starts at 12:00 tomorrow"
  57. },
  58. "end_date": {
  59. "type": "string",
  60. "format": "date-time",
  61. "title": "End date+time of patient event",
  62. "description": "e.g.: your doctor visit ends at 12:00 tomorrow"
  63. }
  64. },
  65. "required": [
  66. "timeline_item_type",
  67. "id",
  68. "description",
  69. "start_date",
  70. "end_date",
  71. "icon",
  72. "title",
  73. "type_key"
  74. ],
  75. "additionalProperties": false
  76. },
  77. "measurement_task": {
  78. "type": "object",
  79. "properties": {
  80. "timeline_item_type": {
  81. "const": "measurement_task"
  82. },
  83. "mtype": {
  84. "type": "string",
  85. "title": "measurement type",
  86. "description": "an enum-like string that tells you what to measure",
  87. "examples": [
  88. "blood_pressure",
  89. "blood_sugar",
  90. "body_weight",
  91. "oxygen",
  92. "pulse",
  93. "temperature"
  94. ],
  95. "pattern": "^[A-Za-z0-9_]+$"
  96. },
  97. "task_id": {
  98. "type": "integer",
  99. "title": "ID of patient task object in server's DB",
  100. "description": "can be used to group multiple occurrences of the same recurring task"
  101. },
  102. "start_date": {
  103. "type": "string",
  104. "format": "date-time",
  105. "description": "Start of time interval, when patient can do the measurement."
  106. },
  107. "due_date": {
  108. "type": "string",
  109. "format": "date-time",
  110. "description": "Due time, before which the patient should do the measurement."
  111. },
  112. "end_date": {
  113. "type": "string",
  114. "format": "date-time",
  115. "description": "End of time interval, when patient can do the measurement.",
  116. "$comment": "may be slightly larger than 'due_date', because we may allow to send overdue measurements to the server"
  117. },
  118. "is_done": {
  119. "type": "boolean",
  120. "title": "Is measurement done by patient?",
  121. "description": "true if server receives a measurement in the start_date/end_date interval"
  122. },
  123. "is_missed": {
  124. "type": "boolean",
  125. "title": "Is due_time missed?",
  126. "description": "true if measurement was made after due_time, or wasn't made at all"
  127. },
  128. "measurements": {
  129. "type": "array",
  130. "items": {
  131. "type": [
  132. "object",
  133. "null"
  134. ],
  135. "description": "A list of measurements made by patient in the start_date/end_date interval",
  136. "examples": [
  137. {
  138. "mid": 1,
  139. "ctime": "2020-02-01T12:00:00.000000Z",
  140. "alert_level": null,
  141. "values": {
  142. "code": {
  143. "coding": [
  144. {
  145. "code": "pulse"
  146. }
  147. ]
  148. },
  149. "valueQuantity": {
  150. "value": 66.73308218457154,
  151. "unit": "BPM"
  152. }
  153. }
  154. },
  155. {
  156. "mid": 2,
  157. "ctime": "2020-02-01T12:05:02.000000Z",
  158. "alert_level": "YELLOW",
  159. "values": {
  160. "component": [
  161. {
  162. "code": {
  163. "coding": [
  164. {
  165. "code": "systolic"
  166. }
  167. ]
  168. },
  169. "valueQuantity": {
  170. "value": 149.64389162882992,
  171. "unit": "mmHg"
  172. }
  173. },
  174. {
  175. "code": {
  176. "coding": [
  177. {
  178. "code": "diastolic"
  179. }
  180. ]
  181. },
  182. "valueQuantity": {
  183. "value": 106.78179536808875,
  184. "unit": "mmHg"
  185. }
  186. }
  187. ],
  188. "notes": [
  189. {
  190. "time": "2019-08-13 08:41:02.365846",
  191. "text": "This is a comment/annotation"
  192. }
  193. ]
  194. }
  195. }
  196. ],
  197. "properties": {
  198. "mid": {
  199. "type": "integer",
  200. "title": "Measurement ID",
  201. "description": "An Unique ID of a Measurement object from server's DB"
  202. },
  203. "ctime": {
  204. "type": "string",
  205. "format": "date-time",
  206. "title": "Creation Time",
  207. "description": "Time when measurement was made (or when recevied by server if measurement time is not known)"
  208. },
  209. "values": {
  210. "type": "object",
  211. "if": {
  212. "$comment": "Check if is a multi-component measurement",
  213. "properties": {
  214. "component": {
  215. "type": "array"
  216. }
  217. }
  218. },
  219. "then": {
  220. "$comment": "Multi-value measurement - an array of value objects is nested under the 'component' key",
  221. "component": {
  222. "type": "array",
  223. "items": {
  224. "$ref": "#/definitions/measurementValue"
  225. }
  226. }
  227. },
  228. "else": {
  229. "$comment": "Single-value measurement",
  230. "$ref": "#/definitions/measurementValue"
  231. }
  232. },
  233. "alert_level": {
  234. "type": [
  235. "string",
  236. "null"
  237. ]
  238. }
  239. },
  240. "required": [
  241. "mid",
  242. "ctime",
  243. "alert_level",
  244. "values"
  245. ],
  246. "additionalProperties": false
  247. }
  248. }
  249. },
  250. "required": [
  251. "timeline_item_type",
  252. "mtype",
  253. "task_id",
  254. "start_date",
  255. "due_date",
  256. "end_date",
  257. "is_done",
  258. "is_missed",
  259. "measurements"
  260. ],
  261. "additionalProperties": false
  262. },
  263. "measurementValue": {
  264. "type": "object",
  265. "examples": [
  266. {
  267. "code": {
  268. "coding": [
  269. {
  270. "code": "blood_glucose"
  271. }
  272. ]
  273. },
  274. "valueQuantity": {
  275. "value": 8.863299622639252,
  276. "unit": "mmol/L"
  277. }
  278. }
  279. ],
  280. "properties": {
  281. "code": {
  282. "type": "object",
  283. "properties": {
  284. "coding": {
  285. "type": "array",
  286. "items": {
  287. "type": "object",
  288. "properties": {
  289. "code": {
  290. "type": "string"
  291. }
  292. },
  293. "required": [
  294. "code"
  295. ]
  296. }
  297. }
  298. },
  299. "required": [
  300. "coding"
  301. ]
  302. },
  303. "valueQuantity": {
  304. "type": "object",
  305. "properties": {
  306. "value": {
  307. "type": "number"
  308. },
  309. "unit": {
  310. "type": "string"
  311. }
  312. },
  313. "required": [
  314. "value",
  315. "unit"
  316. ]
  317. }
  318. },
  319. "required": [
  320. "code",
  321. "valueQuantity"
  322. ]
  323. },
  324. "survey": {
  325. "type": "object",
  326. "properties": {
  327. "timeline_item_type": {
  328. "const": "survey"
  329. },
  330. "task_id": {
  331. "type": "integer",
  332. "title": "ID of patient task object in server's DB",
  333. "description": "can be used to group multiple occurrences of the same recurring task"
  334. },
  335. "title": {
  336. "type": "string"
  337. },
  338. "description": {
  339. "type": [
  340. "string",
  341. "null"
  342. ]
  343. },
  344. "start_date": {
  345. "type": "string",
  346. "format": "date-time",
  347. "description": "Start of time interval when patient can post answers."
  348. },
  349. "due_date": {
  350. "type": "string",
  351. "format": "date-time",
  352. "description": "Due date+time, before which patient should post answers."
  353. },
  354. "end_date": {
  355. "type": "string",
  356. "format": "date-time",
  357. "title": "End of time interval, when patient could post survey answers.",
  358. "$comment": "may be greater than 'due_date' because we may want to accept answers even after due time is reached."
  359. },
  360. "is_done": {
  361. "type": "boolean",
  362. "title": "Is this survey done by patient?",
  363. "description": "true if server received answers in the start_date/due_date time interval"
  364. },
  365. "is_missed": {
  366. "type": "boolean",
  367. "title": "Is due_time missed?",
  368. "description": "true if the survey was done after due_date, or wasn't done at all"
  369. }
  370. },
  371. "required": [
  372. "timeline_item_type",
  373. "task_id",
  374. "title",
  375. "description",
  376. "start_date",
  377. "due_date",
  378. "end_date",
  379. "is_done",
  380. "is_missed"
  381. ],
  382. "additionalProperties": false
  383. },
  384. "global_survey": {
  385. "type": "object",
  386. "properties": {
  387. "timeline_item_type": {
  388. "const": "global_survey"
  389. },
  390. "task_id": {
  391. "type": "integer",
  392. "title": "ID of patient task object in server's DB",
  393. "description": "can be used to group multiple occurrences of the same recurring task"
  394. },
  395. "title": {
  396. "type": "string"
  397. },
  398. "description": {
  399. "type": [
  400. "string",
  401. "null"
  402. ]
  403. },
  404. "start_date": {
  405. "type": "string",
  406. "format": "date-time",
  407. "description": "Start of time interval when patient can post answers."
  408. },
  409. "due_date": {
  410. "type": "string",
  411. "format": "date-time",
  412. "description": "Due date+time, before which patient should post answers."
  413. },
  414. "end_date": {
  415. "type": "string",
  416. "format": "date-time",
  417. "title": "End of time interval, when patient could post survey answers.",
  418. "$comment": "may be greater than 'due_date' because we may want to accept answers even after due time is reached."
  419. },
  420. "is_done": {
  421. "type": "boolean",
  422. "title": "Is this survey done by patient?",
  423. "description": "true if server received answers in the start_date/due_date time interval"
  424. },
  425. "is_missed": {
  426. "type": "boolean",
  427. "title": "Is due_time missed?",
  428. "description": "true if the survey was done after due_date, or wasn't done at all"
  429. }
  430. },
  431. "required": [
  432. "timeline_item_type",
  433. "task_id",
  434. "title",
  435. "description",
  436. "start_date",
  437. "due_date",
  438. "end_date",
  439. "is_done",
  440. "is_missed"
  441. ],
  442. "additionalProperties": false
  443. },
  444. "reminder_task": {
  445. "type": "object",
  446. "properties": {
  447. "timeline_item_type": {
  448. "const": "reminder_task"
  449. },
  450. "task_id": {
  451. "type": "integer",
  452. "title": "ID of patient task object in server's DB",
  453. "description": "can be used to group multiple occurrences of the same recurring task"
  454. },
  455. "title": {
  456. "type": "string"
  457. },
  458. "due_date": {
  459. "type": "string",
  460. "format": "date-time",
  461. "title": "a due time, until the patient should complete the task",
  462. "description": "e.g.: don't forget to wake up today at 08:00"
  463. }
  464. },
  465. "required": [
  466. "timeline_item_type",
  467. "task_id",
  468. "title",
  469. "due_date"
  470. ],
  471. "additionalProperties": false
  472. },
  473. "assignment": {
  474. "type": "object",
  475. "properties": {
  476. "timeline_item_type": {
  477. "const": "assignment"
  478. },
  479. "task_id": {
  480. "type": "integer",
  481. "title": "ID of patient task object in server's DB",
  482. "description": "can be used to group multiple occurrences of the same recurring task"
  483. },
  484. "title": {
  485. "type": "string"
  486. },
  487. "description": {
  488. "type": [
  489. "string",
  490. "null"
  491. ]
  492. },
  493. "type_key": {
  494. "type": [
  495. "string",
  496. "null"
  497. ],
  498. "description": "an enum-like string that indicates a special type of assignment",
  499. "examples": [
  500. "assignment_type/appointment",
  501. "assignment_type/physical_activity",
  502. "assignment_type/videocall"
  503. ],
  504. "pattern": "^assignment_type/[A-Za-z0-9_]+$"
  505. },
  506. "start_date": {
  507. "type": "string",
  508. "format": "date-time",
  509. "title": "date+time when the assignment starts",
  510. "description": "e.g.: you have a videocall tomorrow starting at 13:00"
  511. },
  512. "due_date": {
  513. "type": "string",
  514. "format": "date-time",
  515. "title": "Due date+time, before which the patient must complete the assignment.",
  516. "description": "e.g.: you should go for a walk today before 11:00 AM"
  517. },
  518. "end_date": {
  519. "type": "string",
  520. "format": "date-time",
  521. "description": "The end of the time interval, during which the patient can complete the assignment.",
  522. "$comment": "may be larger than due_date, because we may want to allow overdue tasks"
  523. },
  524. "is_missed": {
  525. "type": "boolean",
  526. "title": "was due_time missed?",
  527. "description": "true if patient didn't done the assignment before due_time"
  528. },
  529. "is_done": {
  530. "type": "boolean",
  531. "title": "is done by patient?",
  532. "description": "true if assignment was done by patient (possibly even after due_time)"
  533. }
  534. },
  535. "required": [
  536. "timeline_item_type",
  537. "task_id",
  538. "title",
  539. "description",
  540. "type_key",
  541. "start_date",
  542. "due_date",
  543. "end_date",
  544. "is_missed",
  545. "is_done"
  546. ],
  547. "additionalProperties": false
  548. }
  549. },
  550. "type": "array",
  551. "items": {
  552. "type": "object",
  553. "properties": {
  554. "timeline_item_type": {
  555. "type": "string",
  556. "enum": [
  557. "patient_event",
  558. "measurement_task",
  559. "survey",
  560. "global_survey",
  561. "reminder_task",
  562. "assignment"
  563. ]
  564. }
  565. },
  566. "oneOf": [
  567. {
  568. "$ref": "#/definitions/patient_event"
  569. },
  570. {
  571. "$ref": "#/definitions/measurement_task"
  572. },
  573. {
  574. "$ref": "#/definitions/survey"
  575. },
  576. {
  577. "$ref": "#/definitions/global_survey"
  578. },
  579. {
  580. "$ref": "#/definitions/reminder_task"
  581. },
  582. {
  583. "$ref": "#/definitions/assignment"
  584. }
  585. ]
  586. }
  587. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement