Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.controller.swaasa;
package com.iemr.common.controller.lungassessment;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -32,17 +32,17 @@
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.iemr.common.service.swaasa.SwaasaService;
import com.iemr.common.service.lungassessment.LungAssessmentService;
import com.iemr.common.utils.response.OutputResponse;

import io.swagger.annotations.ApiOperation;

@RequestMapping(value = "/swaasa")
@RestController
public class SwaasaController {
public class LungAssessmentController {

@Autowired
private SwaasaService swaasaService;
private LungAssessmentService lungAssessmentService;

private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

Expand All @@ -53,12 +53,12 @@ public String startAssesment(@RequestParam("file") MultipartFile file, @RequestP
OutputResponse output = new OutputResponse();
try {

String res = swaasaService.initiateAssesment(request, file);
String res = lungAssessmentService.initiateAssesment(request, file);
output.setResponse(res);

logger.info("start assessment cough response: " + output);
} catch (Exception e) {
logger.error("sawassa failed with error " + e.getMessage(), e);
logger.error("Lung assessment failed with error " + e.getMessage(), e);
output.setError(e);
}
return output.toString();
Expand All @@ -71,12 +71,12 @@ public String getAssessment(@PathVariable("assessmentId") String assessmentId) {
OutputResponse output = new OutputResponse();
try {

String res = swaasaService.getAssesment(assessmentId);
String res = lungAssessmentService.getAssesment(assessmentId);
output.setResponse(res);

logger.info("get assessment cough response: " + output);
} catch (Exception e) {
logger.error("sawassa failed with error " + e.getMessage());
logger.error("Lung assessment failed with error " + e.getMessage());
output.setError(e);
}
return output.toString();
Expand All @@ -89,7 +89,7 @@ public String getAssessmentDetails(@PathVariable("patientId") Long patientId) {
OutputResponse output = new OutputResponse();
try {

String res = swaasaService.getAssessmentDetails(patientId);
String res = lungAssessmentService.getAssessmentDetails(patientId);
output.setResponse(res);

logger.info("get assessment details response: " + output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.data.swaasa;
package com.iemr.common.data.lungassessment;

import java.sql.Timestamp;

Expand All @@ -34,14 +34,13 @@

@Entity
@Table(name = "t_swaasa")
public class Swaasa {
public class LungAssessment {

@Id
@GeneratedValue
@Column(name = "Id", insertable = false)
private Long id;

// request
@Column(name = "Beneficiaryregid")
private Long patientId;
@Column(name = "AssessmentId")
Expand All @@ -51,8 +50,6 @@ public class Swaasa {
@Column(name = "Gender")
private String gender;

// @Column(name = "Time_stamp")
// private Timestamp timestamp;
@Column(name = "frequent_cough")
private Integer frequent_cough;
@Column(name = "sputum")
Expand All @@ -66,7 +63,6 @@ public class Swaasa {
@Column(name = "shortness_of_breath")
private Integer shortness_of_breath;

// response
@Column(name = "record_duration")
private Double record_duration;
@Column(name = "status")
Expand All @@ -84,7 +80,6 @@ public class Swaasa {
@Column(name = "severity")
private String severity;

// others
@Column(name = "ProviderServiceMapID")
private Integer providerServiceMapID;
@Column(name = "Deleted", insertable = false, updatable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.data.swaasa;
package com.iemr.common.data.lungassessment;

import org.springframework.stereotype.Component;

import lombok.ToString;

@Component
@ToString
public class SwaasaAuthenticateResponse {
public class LungAssessmentAuthenticateResponse {

private String status;
private String accessToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.data.swaasa;
package com.iemr.common.data.lungassessment;

import org.springframework.stereotype.Component;

@Component
public class SwaasaAssessmentResponseDTO {
public class LungAssessmentResponseDTO {

private String status;
private Swaasa data;
private LungAssessment data;
private String assessmentId;

public String getStatus() {
Expand All @@ -38,11 +38,11 @@ public void setStatus(String status) {
this.status = status;
}

public Swaasa getData() {
public LungAssessment getData() {
return data;
}

public void setData(Swaasa data) {
public void setData(LungAssessment data) {
this.data = data;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.data.swaasa;
package com.iemr.common.data.lungassessment;

import java.util.Map;

import org.springframework.stereotype.Component;

@Component
public class SwaasaValidateCoughReponseDTO {
public class LungAssessmentValidateCoughReponseDTO {

private String status;
private Map<String, Object> data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.data.swaasa;
package com.iemr.common.data.lungassessment;

import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.repo.swaasa;
package com.iemr.common.repo.lungassessment;

import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.common.data.swaasa.Swaasa;
import com.iemr.common.data.lungassessment.LungAssessment;

@Repository
@RestResource(exported = false)
public interface SwaasaRepository extends CrudRepository<Swaasa, Long> {
public List<Swaasa> findByAssessmentId(String assessmentId);
public interface LungAssessmentRepository extends CrudRepository<LungAssessment, Long> {
public List<LungAssessment> findByAssessmentId(String assessmentId);

public List<Swaasa> findByPatientId(Long patientId);
public List<LungAssessment> findByPatientId(Long patientId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.service.swaasa;
package com.iemr.common.service.lungassessment;

import org.springframework.web.multipart.MultipartFile;

public interface SwaasaService {
public interface LungAssessmentService {

public String getSwaasaAdminLogin(String email, String password) throws Exception;
public String getLungAssessmentAdminLogin(String email, String password) throws Exception;

public Boolean verifyCough(MultipartFile file, String authToken, Long patientId) throws Exception;

Expand Down
Loading