ผู้เขียน หัวข้อ: คำสั่ง update ใน pcu เชิงรุก 1  (อ่าน 13387 ครั้ง)

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

ออฟไลน์ มนตรี บอยรักยุ้ยคนเดียว

  • Hero Member
  • *****
  • กระทู้: 5,369
  • Respect: +12
    • ดูรายละเอียด
    • โรงพยาบาลชุมชน ด่านมะขามเตี้ย
คำสั่ง update ใน pcu เชิงรุก 1
« เมื่อ: ธันวาคม 31, 2008, 21:26:53 PM »
0
ต้องระวังนะครับคำเตือน

สิทธิ์ประกันสังคม
update hipdata
set pttype = '14'
where moi_status in('SSS') and hospmain not in ('10731','10732')

update hipdata
set pttype = '34'
where moi_status in('SSS') and hospmain in ('10731')

update hipdata
set pttype = '34'
where moi_status in('SSS') and hospmain in ('10732')
เริ่ม11พย.2548OPD-Paperlessพร้อมHOSxPลดโลกร้อน
FF-Paperless(รพ.สค.)เริ่ม1ตค2555=100%
IPD-Lesspaper1ตค2560ระบบDmsByNeoNetwork
IPD-Paperless1พ.ค2562ระบบHOSxPXE4
ServerMTOL8.5+MDB-10.4.20,SlaveOL8.5+MDB-10.7.3
LOG=PostgreSQL11,INV=PostgreSQL11

ออฟไลน์ มนตรี บอยรักยุ้ยคนเดียว

  • Hero Member
  • *****
  • กระทู้: 5,369
  • Respect: +12
    • ดูรายละเอียด
    • โรงพยาบาลชุมชน ด่านมะขามเตี้ย
Re: คำสั่ง update ใน pcu เชิงรุก 1
« ตอบกลับ #1 เมื่อ: ธันวาคม 31, 2008, 21:28:13 PM »
0
update person left outer join hipdata on hipdata.cid=person.cid
set person.pttype=(select hipdata.pttype from hipdata where hipdata.cid=person.cid),
person.pttype_no=(select hipdata.cardid from hipdata where hipdata.cid=person.cid),
person.pttype_begin_date=(select hipdata.datein from hipdata where hipdata.cid=person.cid),
person.pttype_expire_date=(select hipdata.dateexp from hipdata where hipdata.cid=person.cid),
person.pttype_hospmain=(select hipdata.hospmain from hipdata where hipdata.cid=person.cid),
person.pttype_hospsub=(select hipdata.hospsub from hipdata where hipdata.cid=person.cid)
where person.cid=hipdata.cid 
สิทธิ์ใน person จะมี
เริ่ม11พย.2548OPD-Paperlessพร้อมHOSxPลดโลกร้อน
FF-Paperless(รพ.สค.)เริ่ม1ตค2555=100%
IPD-Lesspaper1ตค2560ระบบDmsByNeoNetwork
IPD-Paperless1พ.ค2562ระบบHOSxPXE4
ServerMTOL8.5+MDB-10.4.20,SlaveOL8.5+MDB-10.7.3
LOG=PostgreSQL11,INV=PostgreSQL11

ออฟไลน์ มนตรี บอยรักยุ้ยคนเดียว

  • Hero Member
  • *****
  • กระทู้: 5,369
  • Respect: +12
    • ดูรายละเอียด
    • โรงพยาบาลชุมชน ด่านมะขามเตี้ย
ฝากให้น้องกอล์ฟ
« ตอบกลับ #2 เมื่อ: ธันวาคม 31, 2008, 21:30:08 PM »
0
เพิ่ม hn ใน person อิงกับ เลข 13 หลัก

update person left outer join patient on patient.cid=person.cid
set person.patient_hn=(select patient.hn from patient where patient.cid=person.cid
group by  person.person_id
having count(person.cid)='1'
order by person.cid desc)where patient.cid=person.cid

update person left outer join patient on patient.cid=person.cid
set person.patient_link=(select (case patient.hn when 'null' then 'N' else 'Y' end) as link from patient where patient.cid=person.cid
group by  person.person_id
having count(person.cid)='1'
order by person.cid desc)where patient.cid=person.cid
« แก้ไขครั้งสุดท้าย: ธันวาคม 31, 2008, 21:34:41 PM โดย บอย(ด่านมะขามเตี้ย) »
เริ่ม11พย.2548OPD-Paperlessพร้อมHOSxPลดโลกร้อน
FF-Paperless(รพ.สค.)เริ่ม1ตค2555=100%
IPD-Lesspaper1ตค2560ระบบDmsByNeoNetwork
IPD-Paperless1พ.ค2562ระบบHOSxPXE4
ServerMTOL8.5+MDB-10.4.20,SlaveOL8.5+MDB-10.7.3
LOG=PostgreSQL11,INV=PostgreSQL11

ออฟไลน์ Terminator2015

  • Hero Member
  • *****
  • กระทู้: 3,352
  • Achilles : ประวัติศาสตร์จารึกชื่อกษัตริย์ มิได้จารึกชื่อทหาร
  • Respect: +66
    • ดูรายละเอียด
    • โรงพยาบาลนาเชือก
Re: คำสั่ง update ใน pcu เชิงรุก 1
« ตอบกลับ #3 เมื่อ: กุมภาพันธ์ 08, 2009, 16:56:05 PM »
0
แจ๋วมากเลยครับ ขอบคุณมากๆ
นายคณวัชร คำชัย(ทัศ) โรงพยาบาลนาเชือก จ.มหาสารคาม
Mail : nachuak@hotmail.co.th  Tel.  (AIS)0817080646
โรงพยาบาลชุมชน ขนาด 30 เตียง (Paperless OPD)
ดุแล สอ.12 แห่ง HOSxP_PCU 3.59.12.15 NewVersion
ขึ้นระบบเมื่อ 1 ต.ค. 2549

ออฟไลน์ A ROON CHAI

  • Hero Member
  • *****
  • กระทู้: 729
  • Respect: +1
    • ดูรายละเอียด
    • โรงพยาบาลวัดสิงห์
Re: คำสั่ง update ใน pcu เชิงรุก 1
« ตอบกลับ #4 เมื่อ: สิงหาคม 10, 2009, 22:31:13 PM »
0
อ.บอยครับ ตาราง hipdata เก็บอะไรครับ

ของผมไม่มีข้อมูลอะไรเลย
อรุณชัย ชื่นนิ่ม (นักรังสีการแพทย์)
WATSING HOSPITAL CHAINAT.(Tel.056-461344) http://www.watsinghospital.com/
Master Server:IBM system X3550 M3, RAM: 16 GB.,SAS 146X2 GB.
Immage Server:hp proliant ML 110 G6, RAM: 4 GB.,SAS 300 GB.
Replicate(x2): IBM system X3200, RAM: 4 GB.,SAS 73X2 GB.
CentOS 6.3, MySQL 5.5.27-rel
Cient: WindowsXP SP3, HOSxP Version: 3.55.11.28
Start : 02/04/2008 by BMS's team(อ.ตะเกียง)
Active Package : HOSxP Activation Package - 2556(2013-11-06)

บริการ BMS Maintenance Package  http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=10605.msg107543#new
แนะนำตัวเอง   
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=4413.0
"ถามอย่างไร..ให้ได้คำตอบ"  
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=3475.0

ออฟไลน์ skypec

  • Hero Member
  • *****
  • กระทู้: 1,469
  • Respect: +1
    • ดูรายละเอียด
    • โรงพยาบาลรือเสาะ
Re: คำสั่ง update ใน pcu เชิงรุก 1
« ตอบกลับ #5 เมื่อ: สิงหาคม 10, 2009, 22:43:56 PM »
0
ข้อมูลที่นำเข้าจาก Welfare
โรงพยาบาลรือเสาะ ( www.rusohospital.com )
Version HOSxP 3.53.7.28
Machine Server
Master : IBM
Slave   : HP

ออฟไลน์ Apiruk_Jbhos

  • Sr. Member
  • ****
  • กระทู้: 386
  • Respect: +1
    • ดูรายละเอียด
    • โรงพยาบาล สมเด็จพระยุพราช จอมบึง
Re: ฝากให้น้องกอล์ฟ
« ตอบกลับ #6 เมื่อ: กันยายน 18, 2009, 09:28:33 AM »
0
เพิ่ม hn ใน person อิงกับ เลข 13 หลัก

update person left outer join patient on patient.cid=person.cid
set person.patient_hn=(select patient.hn from patient where patient.cid=person.cid
group by  person.person_id
having count(person.cid)='1'
order by person.cid desc)where patient.cid=person.cid

update person left outer join patient on patient.cid=person.cid
set person.patient_link=(select (case patient.hn when 'null' then 'N' else 'Y' end) as link from patient where patient.cid=person.cid
group by  person.person_id
having count(person.cid)='1'
order by person.cid desc)where patient.cid=person.cid

ขอถาม พี่หน่อยครับ ผมลอง up ตาม code ตามที่ให้มาแล้ว เจอปัญหาหน่อยหนึ่งว่า
hn ในตาราง person ขึ้นครับ โดยที่ดูมันจับกันโดย CID ใช่ไหมครับ
แต่ไม่เข้าใจครับว่า ในเมื่อ HN เข้าแล้ว แต่จาการดูปรากฏว่า CID ที่ตาราง Patient มัน ว่างครับ มีบางอัน ก็เป็น เลข 13 หลัก หรือเป็น เลข 1 หมด มีบางราย ส่วนมากจะว่าง เป็นกับกรณี ที่ Patient_link เป็น N ครับ แต่ตอนนี้ Run อีกรอบ
N ไม่มีแล้วครับ เป็น ว่างแทน แต่ Patinet_hn ยังมี HN อยู่ครับ แต่ลองเขียน code เช็ค จับดูโดยใช้ HN จับกัน
ระหว่าง Patient กับ Person โดยที่ Patient_link เป็นค่าว่าง HN ก็ขึ้นตรงกันครับ แต่ CID ของฝัง Patient หายครับ
เป็นค่าว่าง แต่ ฝัง Person CID มีครับ ลองเช็ค โดยเอา HN ไปเทียบกับ 2 ตาราง ชื่อก็ตรงกัน
เลยอยากจะได้ Code up CID จาก Person ไป Patinet ในรายที่ CID หายครับ โดยใช้ HN กับ Patient_hn จับกันครับ
ผมยังสัยสัยว่ามันหายได้ยังไง หรือมันไม่มีตั้งแต่แรก แต่ถ้า ตาราง Patient ถ้า CID ไม่มีแล้ว HN มาเข้าที่ Person ได้ยังไง หรือทำอะไรผิดขั้นตอนครับ อยากขอให้พี่กรุณา วิเคราะห์ ให้หน่อยครับ
นาย อภิรักษ์ ชุ่มชะอุ่ม
Mail advance_pro@hotmail.com
โรงพยาบาล สมเด็จพระยุพราช จอมบึง

Server 1 : SR550 Ram 64G
OS1 : CentOS Linux 7.6
MariaDB version 10.1.19

Server 2 : IBM X3500 Ram 6G
OS2 : CentOS 7.6


ขึ้นระบบ เดือน กรกฎาคม 50
http://www.ChomBungHospital.com/

ออฟไลน์ มนตรี บอยรักยุ้ยคนเดียว

  • Hero Member
  • *****
  • กระทู้: 5,369
  • Respect: +12
    • ดูรายละเอียด
    • โรงพยาบาลชุมชน ด่านมะขามเตี้ย
Re: คำสั่ง update ใน patient ให้อยู่ในเขต
« ตอบกลับ #7 เมื่อ: กรกฎาคม 01, 2010, 16:54:57 PM »
0
update patient
set inregion = "Y"
เริ่ม11พย.2548OPD-Paperlessพร้อมHOSxPลดโลกร้อน
FF-Paperless(รพ.สค.)เริ่ม1ตค2555=100%
IPD-Lesspaper1ตค2560ระบบDmsByNeoNetwork
IPD-Paperless1พ.ค2562ระบบHOSxPXE4
ServerMTOL8.5+MDB-10.4.20,SlaveOL8.5+MDB-10.7.3
LOG=PostgreSQL11,INV=PostgreSQL11