ผู้เขียน หัวข้อ: อยากได้คำสั่ง เลื่อนนัด  (อ่าน 2829 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ annmaster

  • Newbie
  • *
  • กระทู้: 12
  • Respect: 0
    • ดูรายละเอียด
อยากได้คำสั่ง เลื่อนนัด
« เมื่อ: กันยายน 19, 2014, 15:41:41 PM »
0
พอดีพยาบาลอยากได้รายงานเด็กเลื่อนนัด ผมมีรายงานเด็กมาตามนัด กับ เด็กขาดนัดแล้ว  แต่พยาบาลอยากได้ เด็กเลื่อนนัดอีก 1 รายงาน ไม่ทราบว่าจะเขียนคำสั่งอย่างไรดีครับ

คำสั่งเด็กมาตามนัด
select o.nextdate,o.hn,concat(pt.pname,pt.fname," ",pt.lname)as ptname,concat("นาย",pt.fathername," ",pt.fatherlname)as father,
concat("นาง",pt.mathername," ",pt.motherlname)as mother,
concat(pt.addrpart," หมู่ ",pt.moopart)as addressname,concat("ต.",t3.name," อ.",t2.name," จ.",t1.name) as fulladdressname,o.person_vaccine_id from oapp o
left outer join patient pt on pt.hn=o.hn
left outer join thaiaddress t1 on t1.chwpart=pt.chwpart
and t1.amppart="00" and t1.tmbpart="00"
left outer join thaiaddress t2 on t2.chwpart=pt.chwpart
and t2.amppart=pt.amppart and t2.tmbpart="00"
left outer join thaiaddress t3 on t3.chwpart=pt.chwpart
and t3.amppart=pt.amppart and t3.tmbpart=pt.tmbpart
where o.nextdate between "2014-08-01" and "2014-08-31"
and o.person_vaccine_id in ("5","6","7","8","38","39","40","12","13","14","15","16","19","20","21","17","22","18","23")
order by o.nextdate


คำสั่งเด็กขาดนัด
select o.nextdate,o.hn,concat(pt.pname,pt.fname," ",pt.lname)as ptname,concat("นาย",pt.fathername," ",pt.fatherlname)as father,
concat("นาง",pt.mathername," ",pt.motherlname)as mother,
concat(pt.addrpart," หมู่ ",pt.moopart)as addressname,concat("ต.",t3.name," อ.",t2.name," จ.",t1.name) as fulladdressname,o.person_vaccine_id from oapp o
left outer join patient pt on pt.hn=o.hn
left outer join thaiaddress t1 on t1.chwpart=pt.chwpart
and t1.amppart="00" and t1.tmbpart="00"
left outer join thaiaddress t2 on t2.chwpart=pt.chwpart
and t2.amppart=pt.amppart and t2.tmbpart="00"
left outer join thaiaddress t3 on t3.chwpart=pt.chwpart
and t3.amppart=pt.amppart and t3.tmbpart=pt.tmbpart
where o.nextdate between "2014-08-01" and "2014-08-31"
and o.hn not in (select hn from ovst where vstdate between  '2014-09-01' and '2014-09-19' )
and o.person_vaccine_id in ("5","6","7","8","38","39","40","12","13","14","15","16","19","20","21","17","22","18","23")
order by o.nextdate

อยากได้คำสั่ง เลื่อนนัด ครับ ไม่ทราบว่าใช้คำสั่ง sql อย่างไงครับ

 

ออฟไลน์ เกื้อกูล ครับ..

  • Hero Member
  • *****
  • กระทู้: 12,611
  • Respect: +169
    • ดูรายละเอียด
    • โรงพยาบาลปากท่อ
Re: อยากได้คำสั่ง เลื่อนนัด
« ตอบกลับ #1 เมื่อ: กันยายน 19, 2014, 15:55:35 PM »
+1
อืม...แผนกที่นัดต้องลงบันทึกในระบบของการเลือนนัด หรือแก้ไขวันนัดครับ..ในเมนูระบบนัดหมาย..
Implement  HOSxP  Start 2548 ---> NOW!
Station : 130 Client   V.3 Version  3.67.1.XX
Server  : CENTOS  +MySQL maria 10.x.x