cambios consulta informes
This commit is contained in:
@ -43,26 +43,26 @@ defmodule Api.Downloadpdf do
|
|||||||
patientname: fragment("replace(?, '^', ' ')", p.patientname),
|
patientname: fragment("replace(?, '^', ' ')", p.patientname),
|
||||||
studydate: fragment("TO_CHAR(?, 'YYYY-MM-DD')", s.studydate),
|
studydate: fragment("TO_CHAR(?, 'YYYY-MM-DD')", s.studydate),
|
||||||
studytime: s.studytime,
|
studytime: s.studytime,
|
||||||
studydescription: s.studydescription,
|
studydescription: fragment("COALESCE(?, '')", s.studydescription),
|
||||||
proceduredescription: s.proceduredescription,
|
proceduredescription: fragment("COALESCE(?, '')", s.proceduredescription),
|
||||||
procedurecode: s.procedurecode,
|
procedurecode: fragment("COALESCE(?, '')", s.procedurecode),
|
||||||
modality: s.modality,
|
modality: s.modality,
|
||||||
patientid: p.patientid,
|
patientid: p.patientid,
|
||||||
patientbirthdate: fragment("TO_CHAR(?, 'YYYY-MM-DD')", p.patientbirthdate),
|
patientbirthdate: fragment("TO_CHAR(?, 'YYYY-MM-DD')", p.patientbirthdate),
|
||||||
fin_signature: pr.signature,
|
fin_signature: fragment("COALESCE(?, '')", pr.signature),
|
||||||
matricula_finalized: fragment("COALESCE(?, '')",pr.matricula),
|
matricula_finalized: fragment("COALESCE(?, '')", pr.matricula),
|
||||||
informantphysician: u.username,
|
informantphysician: u.username,
|
||||||
insurer: fragment("COALESCE(?, '')",s.insurer),
|
insurer: fragment("COALESCE(?, '')", s.insurer),
|
||||||
institutionname: s.institutionname,
|
institutionname: fragment("COALESCE(?, '')", s.institutionname),
|
||||||
referringphysiciansname: fragment("COALESCE(?, '')", s.referringphysiciansname),
|
referringphysiciansname: fragment("COALESCE(?, '')", s.referringphysiciansname)
|
||||||
servicio: fragment("COALESCE(?, '')", s.servicio)
|
# servicio: fragment("COALESCE(?, '')", s.servicio)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
result = Repo.one(
|
result = Repo.one(
|
||||||
from q in subquery(query),
|
from q in subquery(query),
|
||||||
select: fragment("json_build_object('idstudyreport', ?, 'body', ?, 'idstudy', ?, 'accessionnumber', ?, 'patientname', ?, 'studydate', ?, 'studytime', ?, 'studydescription', ?, 'proceduredescription', ?, 'procedurecode', ?, 'modality', ?, 'patientid', ?, 'patientbirthdate', ?, 'fin_signature', ?, 'matricula_finalized', ?, 'informantphysician', ?, 'insurer', ?, 'institutionname', ?, 'referringphysiciansname', ?, 'printtemplate', ?, 'servicio', ?)",
|
select: fragment("json_build_object('idstudyreport', ?, 'body', ?, 'idstudy', ?, 'accessionnumber', ?, 'patientname', ?, 'studydate', ?, 'studytime', ?, 'studydescription', ?, 'proceduredescription', ?, 'procedurecode', ?, 'modality', ?, 'patientid', ?, 'patientbirthdate', ?, 'fin_signature', ?, 'matricula_finalized', ?, 'informantphysician', ?, 'insurer', ?, 'institutionname', ?, 'referringphysiciansname', ?, 'printtemplate', ?)",
|
||||||
q.idstudyreport, q.body, q.idstudy, q.accessionnumber, q.patientname, q.studydate, q.studytime, q.studydescription, q.proceduredescription, q.procedurecode, q.modality, q.patientid, q.patientbirthdate, q.fin_signature, q.matricula_finalized, q.informantphysician, q.insurer, q.institutionname, q.referringphysiciansname, q.printtemplate, q.servicio
|
q.idstudyreport, q.body, q.idstudy, q.accessionnumber, q.patientname, q.studydate, q.studytime, q.studydescription, q.proceduredescription, q.procedurecode, q.modality, q.patientid, q.patientbirthdate, q.fin_signature, q.matricula_finalized, q.informantphysician, q.insurer, q.institutionname, q.referringphysiciansname, q.printtemplate
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Logger.info("#{inspect(result)}")
|
Logger.info("#{inspect(result)}")
|
||||||
|
Reference in New Issue
Block a user