Skip to content

Commit 6862011

Browse files
committed
split sp
1 parent f82a35e commit 6862011

File tree

4 files changed

+84
-110
lines changed

4 files changed

+84
-110
lines changed

.github/workflows/file-merge.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Merge sql files
2+
3+
on:
4+
workflow_run:
5+
types:
6+
- completed
7+
workflows:
8+
# List all required workflow names here.
9+
- 'Automated CI testing'
10+
11+
jobs:
12+
merge-files:
13+
name: Merge files!
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Merge me!
18+
run : |
19+
mkdir output
20+
cat "Migration script/openIMIS migration latest.sql" "Migration script/storedProceduresl/*" > output/fullMigrationScipt.sql
21+
cat "Empty databasesopenIMIS_ONLINE.sql" "Migration script/storedProceduresl/*" > output/fullEmptyDatabase.sql
22+
cat "Empty databasesopenIMIS_ONLINE.sql" "Demo database/openIMIS_demo_ONLINE.sql" "Migration script/storedProceduresl/*" > output/fullEmptyDatabase.sql
23+
- name: Publish artifact
24+
uses: actions/upload-artifact@master
25+
with:
26+
name: sql-files
27+
path: output

Empty databases/openIMIS_ONLINE.sql

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -27448,59 +27448,6 @@ BEGIN
2744827448
END
2744927449
GO
2745027450

27451-
CREATE PROCEDURE [dbo].[uspSSRSRetrieveCapitationPaymentReportData]
27452-
(
27453-
@RegionId INT = NULL,
27454-
@DistrictId INT = NULL,
27455-
@ProdId INT,
27456-
@Year INT,
27457-
@Month INT,
27458-
@HFLevel xAttributeV READONLY
27459-
)
27460-
AS
27461-
BEGIN
27462-
declare @listOfHF table (id int);
27463-
27464-
IF @RegionId IS NULL or @RegionId =0
27465-
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF WHERE tblHF.ValidityTo is NULL;
27466-
ELSE IF @DistrictId is NULL or @DistrictId =0
27467-
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF JOIN tblLocations l on tblHF.LocationId = l.LocationId WHERE l.ParentLocationId = @RegionId ;
27468-
ELSE
27469-
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF WHERE tblHF.LocationId = @DistrictId and tblHF.ValidityTo is NULL;
27470-
27471-
27472-
SELECT RegionCode,
27473-
RegionName,
27474-
DistrictCode,
27475-
DistrictName,
27476-
HFCode,
27477-
HFName,
27478-
AccCode,
27479-
HFLevel,
27480-
HFSublevel,
27481-
TotalPopulation[Population],
27482-
TotalFamilies,
27483-
TotalInsuredInsuree,
27484-
TotalInsuredFamilies,
27485-
TotalClaims,
27486-
AlcContriPopulation,
27487-
AlcContriNumFamilies,
27488-
AlcContriInsPopulation,
27489-
AlcContriInsFamilies,
27490-
AlcContriVisits,
27491-
AlcContriAdjustedAmount,
27492-
UPPopulation,
27493-
UPNumFamilies,
27494-
UPInsPopulation,
27495-
UPInsFamilies,
27496-
UPVisits,
27497-
UPAdjustedAmount,
27498-
PaymentCathment,
27499-
TotalAdjusted
27500-
FROM tblCapitationPayment WHERE [year] = @Year AND [month] = @Month AND HfID in (SELECT id from @listOfHF) AND @ProdId = ProductID;
27501-
END
27502-
GO
27503-
2750427451
CREATE PROCEDURE [dbo].[uspAPIGetClaims]
2750527452
(
2750627453
@ClaimAdminCode NVARCHAR(MAX),

Migration script/openIMIS migration latest.sql

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6914,63 +6914,6 @@ BEGIN
69146914
END
69156915
GO
69166916

6917-
IF OBJECT_ID('uspSSRSRetrieveCapitationPaymentReportData', 'P') IS NOT NULL
6918-
DROP PROCEDURE uspSSRSRetrieveCapitationPaymentReportData
6919-
GO
6920-
6921-
CREATE PROCEDURE [dbo].[uspSSRSRetrieveCapitationPaymentReportData]
6922-
(
6923-
@RegionId INT = NULL,
6924-
@DistrictId INT = NULL,
6925-
@ProdId INT,
6926-
@Year INT,
6927-
@Month INT,
6928-
@HFLevel xAttributeV READONLY
6929-
)
6930-
AS
6931-
BEGIN
6932-
declare @listOfHF table (id int);
6933-
6934-
IF @RegionId IS NULL or @RegionId =0
6935-
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF WHERE tblHF.ValidityTo is NULL;
6936-
ELSE IF @DistrictId is NULL or @DistrictId =0
6937-
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF JOIN tblLocations l on tblHF.LocationId = l.LocationId WHERE l.ParentLocationId = @RegionId ;
6938-
ELSE
6939-
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF WHERE tblHF.LocationId = @DistrictId and tblHF.ValidityTo is NULL;
6940-
6941-
6942-
SELECT RegionCode,
6943-
RegionName,
6944-
DistrictCode,
6945-
DistrictName,
6946-
HFCode,
6947-
HFName,
6948-
AccCode,
6949-
HFLevel,
6950-
HFSublevel,
6951-
TotalPopulation[Population],
6952-
TotalFamilies,
6953-
TotalInsuredInsuree,
6954-
TotalInsuredFamilies,
6955-
TotalClaims,
6956-
AlcContriPopulation,
6957-
AlcContriNumFamilies,
6958-
AlcContriInsPopulation,
6959-
AlcContriInsFamilies,
6960-
AlcContriVisits,
6961-
AlcContriAdjustedAmount,
6962-
UPPopulation,
6963-
UPNumFamilies,
6964-
UPInsPopulation,
6965-
UPInsFamilies,
6966-
UPVisits,
6967-
UPAdjustedAmount,
6968-
PaymentCathment,
6969-
TotalAdjusted
6970-
FROM tblCapitationPayment WHERE [year] = @Year AND [month] = @Month AND HfID in (SELECT id from @listOfHF) AND @ProdId = ProductID;
6971-
END
6972-
GO
6973-
69746917
IF OBJECT_ID('uspAcknowledgeControlNumberRequest', 'P') IS NOT NULL
69756918
DROP PROCEDURE uspAcknowledgeControlNumberRequest
69766919
GO
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
IF OBJECT_ID('uspSSRSRetrieveCapitationPaymentReportData', 'P') IS NOT NULL
3+
DROP PROCEDURE uspSSRSRetrieveCapitationPaymentReportData
4+
GO
5+
6+
CREATE PROCEDURE [dbo].[uspSSRSRetrieveCapitationPaymentReportData]
7+
(
8+
@RegionId INT = NULL,
9+
@DistrictId INT = NULL,
10+
@ProdId INT,
11+
@Year INT,
12+
@Month INT,
13+
@HFLevel xAttributeV READONLY
14+
)
15+
AS
16+
BEGIN
17+
declare @listOfHF table (id int);
18+
19+
IF @RegionId IS NULL or @RegionId =0
20+
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF WHERE tblHF.ValidityTo is NULL;
21+
ELSE IF @DistrictId is NULL or @DistrictId =0
22+
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF JOIN tblLocations l on tblHF.LocationId = l.LocationId WHERE l.ParentLocationId = @RegionId ;
23+
ELSE
24+
INSERT INTO @listOfHF(id) SELECT tblHF.HfID FROM tblHF WHERE tblHF.LocationId = @DistrictId and tblHF.ValidityTo is NULL;
25+
26+
27+
SELECT RegionCode,
28+
RegionName,
29+
DistrictCode,
30+
DistrictName,
31+
HFCode,
32+
HFName,
33+
AccCode,
34+
HFLevel,
35+
HFSublevel,
36+
TotalPopulation[Population],
37+
TotalFamilies,
38+
TotalInsuredInsuree,
39+
TotalInsuredFamilies,
40+
TotalClaims,
41+
AlcContriPopulation,
42+
AlcContriNumFamilies,
43+
AlcContriInsPopulation,
44+
AlcContriInsFamilies,
45+
AlcContriVisits,
46+
AlcContriAdjustedAmount,
47+
UPPopulation,
48+
UPNumFamilies,
49+
UPInsPopulation,
50+
UPInsFamilies,
51+
UPVisits,
52+
UPAdjustedAmount,
53+
PaymentCathment,
54+
TotalAdjusted
55+
FROM tblCapitationPayment WHERE [year] = @Year AND [month] = @Month AND HfID in (SELECT id from @listOfHF) AND @ProdId = ProductID;
56+
END
57+
GO

0 commit comments

Comments
 (0)