|
572 | 572 | [identifier (gen/vector (identifier))
|
573 | 573 | status (rare-nil (code))
|
574 | 574 | input (gen/vector (task-input))])
|
| 575 | + |
| 576 | +(defn consent-policy |
| 577 | + [& {:keys [id extension authority uri] |
| 578 | + :or {id (often-nil id-value) |
| 579 | + extension (extensions) |
| 580 | + authority (nilable (uri)) |
| 581 | + uri (nilable (uri))}}] |
| 582 | + (->> (gen/tuple id extension authority uri) |
| 583 | + (to-map [:id :extension :authority :uri]) |
| 584 | + (fhir-type :fhir.Consent/policy))) |
| 585 | + |
| 586 | +(defn consent-verification |
| 587 | + [& {:keys [id extension verified verifiedWith verificationDate] |
| 588 | + :or {id (often-nil id-value) |
| 589 | + extension (extensions) |
| 590 | + verified (boolean) |
| 591 | + verifiedWith (nilable (reference)) |
| 592 | + verificationDate (nilable (dateTime))}}] |
| 593 | + (->> (gen/tuple id extension verified verifiedWith verificationDate) |
| 594 | + (to-map [:id :extension :verified :verifiedWith :verificationDate]) |
| 595 | + (fhir-type :fhir.Consent/verification))) |
| 596 | + |
| 597 | +(defn consent-provision-actor |
| 598 | + [& {:keys [id extension role reference] |
| 599 | + :or {id (often-nil id-value) |
| 600 | + extension (extensions) |
| 601 | + role (codeable-concept) |
| 602 | + reference (reference)}}] |
| 603 | + (->> (gen/tuple id extension role reference) |
| 604 | + (to-map [:id :extension :role :reference]) |
| 605 | + (fhir-type :fhir.Consent.provision/actor))) |
| 606 | + |
| 607 | +(defn consent-provision-data |
| 608 | + [& {:keys [id extension meaning reference] |
| 609 | + :or {id (often-nil id-value) |
| 610 | + extension (extensions) |
| 611 | + meaning (code) |
| 612 | + reference (reference)}}] |
| 613 | + (->> (gen/tuple id extension meaning reference) |
| 614 | + (to-map [:id :extension :meaning :reference]) |
| 615 | + (fhir-type :fhir.Consent.provision/data))) |
| 616 | + |
| 617 | +(defn consent-provision |
| 618 | + [& {:keys [id extension type period actor action securityLabel purpose class |
| 619 | + code dataPeriod data] |
| 620 | + :or {id (often-nil id-value) |
| 621 | + extension (extensions) |
| 622 | + type (nilable (code)) |
| 623 | + period (nilable (period)) |
| 624 | + actor (gen/vector (consent-provision-actor)) |
| 625 | + action (gen/vector (codeable-concept)) |
| 626 | + securityLabel (gen/vector (coding)) |
| 627 | + purpose (gen/vector (coding)) |
| 628 | + class (gen/vector (coding)) |
| 629 | + code (gen/vector (codeable-concept)) |
| 630 | + dataPeriod (nilable (blaze.fhir.spec.generators/period)) |
| 631 | + data (gen/vector (consent-provision-data))}}] |
| 632 | + (->> (gen/tuple id extension type period actor action securityLabel purpose |
| 633 | + class code dataPeriod data) |
| 634 | + (to-map [:id :extension :type :period :actor :action :securityLabel |
| 635 | + :purpose :class :code :dataPeriod :data :provision]) |
| 636 | + (fhir-type :fhir.Consent/provision))) |
| 637 | + |
| 638 | +(def-resource-gen consent |
| 639 | + [identifier (gen/vector (identifier)) |
| 640 | + status (code) |
| 641 | + policy (gen/vector (consent-policy)) |
| 642 | + policyRule (nilable (codeable-concept)) |
| 643 | + verification (gen/vector (consent-verification)) |
| 644 | + provision (nilable (consent-provision {:provision (gen/vector (consent-provision))}))]) |
0 commit comments