I am making a medical software and I am stuck at a point. I have to make a report section where user will fill up the reports for the patient. The main catch is since the fields/column is variable(less/more). Say if I fill up form in blood test, columns option are different and for X-ray columns is different.
I have made a database so it will store option values for that test id and patient id
CREATE TABLE IF NOT EXISTS `mp_tests_options` (
`test_optn_id` int(11) NOT NULL AUTO_INCREMENT,
`optn_test_id` int(11) NOT NULL,
`optn_patient_id` int(11) NOT NULL,
`test_optn_name` varchar(255) NOT NULL,
`test_optn_value` LONGTEXT DEFAULT NULL,
`test_optn_def_value` LONGTEXT DEFAULT NULL,
PRIMARY KEY (`test_optn_id`),
INDEX (`optn_test_id`),
INDEX (`optn_patient_id`),
FOREIGN KEY (optn_test_id) REFERENCES mp_tests(test_id)
ON UPDATE CASCADE ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
But how do i make the front end for user with proper validation. I dont want to write each form individually.
Thanks for your time.