jeniferfleurant icon

mother children pcr

jeniferfleurant | PRO | 08/06/19 06:58:13 PM UTC | 0 ⭐ | 4322 👁️ | Never ⏰ | []
MySQL |

1.06 KB

|

None

|

0 👍

/

0 👎

SELECT 
    patient.patient_code AS infant_code,
    COALESCE(date_of_birth, infant_dob) AS infant_dob,
    CONCAT(testing_mereenfant.mother_city_code,
            '/',
            testing_mereenfant.mother_hospital_code,
            '/',
            testing_mereenfant.mother_code) AS mother_code_on_form,
    x.patient_code AS mother_code_on_hiv,
    date_blood_taken,
    name AS pcr_result
FROM
    testing_specimen
        LEFT JOIN
    testing_mereenfant ON testing_mereenfant.id_patient = testing_specimen.id_patient
        LEFT JOIN
    (SELECT 
        patient_code
    FROM
        tracking_motherbasicinfo
    LEFT JOIN patient ON patient.id = tracking_motherbasicinfo.id_patient) x ON x.patient_code = CONCAT(testing_mereenfant.mother_city_code,
            '/',
            testing_mereenfant.mother_hospital_code,
            '/',
            testing_mereenfant.mother_code)
        LEFT JOIN
    patient ON patient.id = testing_specimen.id_patient
        LEFT JOIN
    lookup_testing_lab_result ON lookup_testing_lab_result.id = pcr_result

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎