import gql from 'graphql-tag' ; import { Action } from '@client/forms' ; export const GET_DEATH_REGISTRATION_FOR_REVIEW = gql `
  query data($id: ID!) {
    fetchDeathRegistration(id: $id) {
      _fhirIDMap
      id
      deceased {
        id
        name {
          use
          firstNames
          familyName
        }
        birthDate
        age
        gender
        maritalStatus
        nationality
        identifier {
          id
          type
          otherType
        }
        gender
        deceased {
          deathDate
        }
        address {
          type
          line
          district
          state
          city
          postalCode
          country
        }
      }
      informant {
        id
        relationship
        otherRelationship
        individual {
          id
          identifier {
            id
            type
            otherType
          }
          name {
            use
            firstNames
            familyName
          }
          nationality
          occupation
          birthDate
          telecom {
            system
            value
          }
          address {
            type
            line
            district
            state
            city
            postalCode
            country
          }
        }
      }
      father {
        id
        name {
          use
          firstNames
          familyName
        }
      }
      mother {
        id
        name {
          use
          firstNames
          familyName
        }
      }
      spouse {
        id
        name {
          use
          firstNames
          familyName
        }
      }
      medicalPractitioner {
        name
        qualification
        lastVisitDate
      }
      registration {
        id
        contact
        contactRelationship
        contactPhoneNumber
        attachments {
          data
          type
          contentType
          subject
        }
        status {
          type
          timestamp
        }
        type
        trackingId
        registrationNumber
      }
      eventLocation {
        id
        type
        address {
          type
          line
          district
          state
          city
          postalCode
          country
        }
      }
      mannerOfDeath
      causeOfDeath
      maleDependentsOfDeceased
      femaleDependentsOfDeceased
    }
  }
` ; export const GET_DEATH_REGISTRATION_FOR_CERTIFICATION = gql `
  query data($id: ID!) {
    fetchDeathRegistration(id: $id) {
      _fhirIDMap
      id
      deceased {
        id
        name {
          use
          firstNames
          familyName
        }
        birthDate
        age
        gender
        maritalStatus
        nationality
        identifier {
          id
          type
          otherType
        }
        gender
        deceased {
          deathDate
        }
        address {
          type
          line
          district
          state
          city
          postalCode
          country
        }
      }
      informant {
        id
        relationship
        otherRelationship
        individual {
          id
          identifier {
            id
            type
            otherType
          }
          name {
            use
            firstNames
            familyName
          }
          nationality
          occupation
          birthDate
          telecom {
            system
            value
          }
          address {
            type
            line
            district
            state
            city
            postalCode
            country
          }
        }
      }
      father {
        id
        name {
          use
          firstNames
          familyName
        }
      }
      mother {
        id
        name {
          use
          firstNames
          familyName
        }
      }
      spouse {
        id
        name {
          use
          firstNames
          familyName
        }
      }
      medicalPractitioner {
        name
        qualification
        lastVisitDate
      }
      registration {
        id
        contact
        contactRelationship
        contactPhoneNumber
        status {
          comments {
            comment
          }
          type
          timestamp
          location {
            name
            alias
          }
          office {
            name
            alias
            address {
              district
              state
            }
          }
        }
        type
        trackingId
        registrationNumber
      }
      eventLocation {
        id
        type
        address {
          type
          line
          district
          state
          city
          postalCode
          country
        }
      }
      mannerOfDeath
      causeOfDeathMethod
      causeOfDeath
      maleDependentsOfDeceased
      femaleDependentsOfDeceased
    }
  }
` ; export function getDeathQueryMappings ( action ) { switch ( action ) { case Action . LOAD_REVIEW_APPLICATION : return { query : GET_DEATH_REGISTRATION_FOR_REVIEW , dataKey : 'fetchDeathRegistration' } ; case Action . LOAD_CERTIFICATE_APPLICATION : return { query : GET_DEATH_REGISTRATION_FOR_CERTIFICATION , dataKey : 'fetchDeathRegistration' } ; default : return null ; } }