-- CarePulse IoT — starter device model library (central DB).
-- certified = 0 until the model passes the CarePulse test-lab checklist (docs/DEVICE_CERTIFICATION.md).
-- ble_service = 16-bit Bluetooth SIG GATT service used for auto-detection by the Android gateway.

INSERT INTO device_models (category, manufacturer, model, connection, ble_service, name_prefix, parameters, protocol_notes, certified, phase) VALUES
-- ===== Phase 1: home / clinic vitals over Bluetooth LE standard profiles =====
('bp_monitor','Generic','Any BLE Blood Pressure profile monitor','ble_standard','1810',NULL,'bp_sys,bp_dia,bp_map,pulse','Bluetooth SIG Blood Pressure Service 0x1810, Measurement char 0x2A35 (indicate).',0,1),
('bp_monitor','Omron','Bluetooth BP monitor (Omron Connect series)','ble_standard','1810','BLESmart','bp_sys,bp_dia,bp_map,pulse','Standard 0x1810 + Omron pairing mode. Verify per model in test lab.',0,1),
('bp_monitor','Dr Trust','Bluetooth BP monitor','ble_standard','1810',NULL,'bp_sys,bp_dia,pulse','Verify standard profile per model.',0,1),
('bp_monitor','Rossmax','Bluetooth BP monitor','ble_standard','1810',NULL,'bp_sys,bp_dia,pulse','Verify standard profile per model.',0,1),
('bp_monitor','A&D Medical','UA series Bluetooth BP monitor','ble_standard','1810','A&D','bp_sys,bp_dia,bp_map,pulse','Standard 0x1810.',0,1),
('thermometer','Generic','Any BLE Health Thermometer','ble_standard','1809',NULL,'temp','Health Thermometer Service 0x1809, Temperature Measurement 0x2A1C.',0,1),
('pulse_oximeter','Generic','Any BLE Pulse Oximeter profile device','ble_standard','1822',NULL,'spo2,pulse,pi','Pulse Oximeter Service 0x1822, Spot-check 0x2A5E, Continuous 0x2A5F.',0,1),
('pulse_oximeter','Contec','CMS50 series Bluetooth oximeter','ble_vendor',NULL,'SpO2','spo2,pulse,pi','Vendor serial-over-BLE protocol; adapter in Android app (ContecParser).',0,1),
('pulse_oximeter','Nonin','3230 Bluetooth oximeter','ble_standard','1822','Nonin','spo2,pulse','Standard 0x1822.',0,1),
('glucometer','Generic','Any BLE Glucose profile meter','ble_standard','1808',NULL,'glucose','Glucose Service 0x1808, Measurement 0x2A18 + RACP 0x2A52 for memory sync.',0,1),
('glucometer','Roche','Accu-Chek Bluetooth meter','ble_standard','1808','meter','glucose','Standard 0x1808 with RACP record sync.',0,1),
('glucometer','Ascensia','Contour Next One','ble_standard','1808','Contour','glucose','Standard 0x1808 with RACP record sync.',0,1),
('weight_scale','Generic','Any BLE Weight Scale profile scale','ble_standard','181D',NULL,'weight,bmi','Weight Scale Service 0x181D, Measurement 0x2A9D. BMI computed from patient height if not sent.',0,1),
('body_composition','Generic','Any BLE Body Composition scale','ble_standard','181B',NULL,'weight,body_fat,bmi','Body Composition Service 0x181B, Measurement 0x2A9C.',0,1),
('heart_rate','Generic','Any BLE Heart Rate strap/band','ble_standard','180D',NULL,'hr','Heart Rate Service 0x180D, Measurement 0x2A37.',0,1),
('any','Any','Device without connectivity - photo of display (AI read)','photo',NULL,NULL,'bp_sys,bp_dia,pulse,spo2,temp,glucose,weight','Photo of the device screen read by AI; reading saved as pending until confirmed.',1,1),
('any','Any','Manual entry','manual',NULL,NULL,'bp_sys,bp_dia,pulse,spo2,temp,glucose,weight,rr,hr','Typed by staff or patient.',1,1),
('any','Any','Device Adapter API (REST/MQTT)','mqtt',NULL,NULL,'bp_sys,bp_dia,pulse,hr,spo2,temp,glucose,weight,rr','Manufacturer pushes JSON per docs/DEVICE_ADAPTER_API.md.',1,1),
-- ===== Phase 2: hospital connectivity =====
('patient_monitor','Mindray','BeneVision / ePM / uMEC via eGateway','hl7',NULL,NULL,'hr,spo2,rr,bp_sys,bp_dia,bp_map,temp,etco2','HL7 v2 ORU^R01 over MLLP (IHE PCD-01) from eGateway or direct monitor HL7 to CarePulse Edge.',0,2),
('patient_monitor','Philips','IntelliVue via Information Center / IntelliBridge','hl7',NULL,NULL,'hr,spo2,rr,bp_sys,bp_dia,bp_map,temp,etco2','HL7 ORU outbound from PIC iX / IntelliBridge Enterprise to CarePulse Edge.',0,2),
('patient_monitor','GE HealthCare','CARESCAPE via Gateway','hl7',NULL,NULL,'hr,spo2,rr,bp_sys,bp_dia,bp_map,temp,etco2','HL7 v2 outbound from CARESCAPE Gateway.',0,2),
('patient_monitor','Nihon Kohden','Life Scope via gateway','hl7',NULL,NULL,'hr,spo2,rr,bp_sys,bp_dia,temp','HL7 v2 outbound via vendor gateway.',0,2),
('patient_monitor','BPL / Skanray / Nasan / Edan','Indian & value-segment monitors','serial',NULL,NULL,'hr,spo2,rr,bp_sys,bp_dia,temp','HL7 where available, otherwise serial/LAN vendor protocol via Edge driver.',0,2),
('ecg','BPL / Schiller / GE / Philips / Edan','12-lead resting ECG','file',NULL,NULL,'hr','Export folder watch: PDF, XML, SCP-ECG, DICOM ECG.',0,2),
('fridge_sensor','Generic','Wi-Fi / LoRaWAN / GSM temperature probe','mqtt',NULL,NULL,'fridge_temp','MQTT JSON to broker; cold chain for blood bank, pharmacy, vaccines.',0,2),
('room_sensor','Generic','Temperature / humidity / differential pressure sensor','mqtt',NULL,NULL,'room_temp,humidity,pressure_diff','MQTT or Modbus via Edge.',0,2);
