   modifiedby userid,
   modified   TIMESTAMP,
 
-  CONSTRAINT PK_drug_regimens_to_frequency_threshold PRIMARY KEY (drug_id, threshold_id),
+  CONSTRAINT PK_drug_regimens_to_frequency_threshold PRIMARY KEY (drug_regimen_id, threshold_id),
   CONSTRAINT FK_drug_regimens_to_frequency_threshold_drug_regimens FOREIGN KEY (drug_regimen_id) REFERENCES wnprc_compliance.drug_regimens (id),
   CONSTRAINT FK_drug_regimens_to_frequency_threshold_thresholds FOREIGN KEY (threshold_id) REFERENCES wnprc_compliance.drug_regimen_frequency_threshold (id)
 );

  CONSTRAINT PK_surgery_info PRIMARY KEY (surgery_id)
);

DROP TABLE wnprc_compliance.allowed_surgeries_to_drug_regimens;
CREATE TABLE wnprc_compliance.allowed_surgeries_to_drug_regimens (
  surgery_id TEXT,
  drug_regimen_id TEXT,

  modifiedby userid,
  modified   TIMESTAMP,

  CONSTRAINT PK_drug_regimens PRIMARY KEY (id)
);

DROP TABLE IF EXISTS wnprc_compliance.drug_regimens_to_allowed_procedures;
