alter table "LabTemplateHeader" add column
 "IsMethod" bool default false,
 add column "MethodText" text,
 add column "IsInterpretation" bool default false,
 add column "InterpretationText" text;
----------

drop table if exists "LabSampleType" cascade;

create table "LabSampleType"(
			"LabSampleTypeId" serial primary key,
			"TypeName" text
);

drop table if exists "LabMainDetail" cascade;

create table "LabMainDetail"(
			 "LabMainDetailId"	serial primary key,
			 "TestName" text,
			 "LabDepartmentId" int references "LabDepartment"("LabDepartmentId"),
			 "TestCode" text,
			 "LabSampleTypeId" int references "LabSampleType"("LabSampleTypeId"),
			 "Active" bool default true,
			 "IsInternalLab" bool default true,
			 "IsExternalLab" bool default false,
			 "CreatedBy" int references "Account"("AccountId"),
			 "CreatedDate" timestamp without time zone,
 			 "ModifiedBy" int references "Account"("AccountId"),
			 "ModifiedDate" timestamp without time zone
);

drop table if exists "LabMainDetailCharge" cascade;

create table "LabMainDetailCharge"(
			 "LabMainDetailChargeId" bigserial primary key,
			 "LabMainDetailId" int references "LabMainDetail"("LabMainDetailId"),
			 "ChargeCategoryId" int references "ChargeCategory"("ChargeCategoryId"),
			 "Rate" numeric(10,2),
			 "LocationId" int references "Location"("LocationId")
);

drop table if exists "LabMainDetailTemplate" cascade;

create table "LabMainDetailTemplate"(
				"LabMainDetailTemplateId" bigserial primary key,
				 "LabMainDetailId" int references "LabMainDetail"("LabMainDetailId"),
				"LabTemplateHeaderId" int references "LabTemplateHeader"("LabTemplateHeaderId"),
				"Priority" int
);
