forked from atulai-sg/abdm-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 30
Implemented HIU Discovery #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Beavj
wants to merge
3
commits into
NHA-ABDM:master
Choose a base branch
from
Beavj:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/nha/abdm/wrapper/hiu/facade/discovery/HIUFacadeDiscoveryController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.facade.discovery; | ||
|
|
||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.HIUFacadeDiscoverControllerInterface; | ||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.requests.HIUDiscoverRequest; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| @RestController | ||
| @RequestMapping(path = "/v1/care-contexts") | ||
| public class HIUFacadeDiscoveryController { | ||
| @Autowired HIUFacadeDiscoverControllerInterface hiuFacadeDiscoverControllerInterface; | ||
|
|
||
| @PostMapping("/discover") | ||
| public ResponseEntity<Object> hiuDiscoverResponse( | ||
| @RequestHeader(value = "X-AUTH-TOKEN") String xAuthToken, | ||
| @RequestBody HIUDiscoverRequest discoverRequest) { | ||
| return hiuFacadeDiscoverControllerInterface.initiateDiscover(discoverRequest, xAuthToken); | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/nha/abdm/wrapper/hiu/facade/link/HIUFacadeLinkController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.facade.link; | ||
|
|
||
| import com.nha.abdm.wrapper.hiu.hrp.link.HIUFacadeLinkControllerInterface; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.HIUConfirmRequest; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.HIUInitRequest; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| @RestController | ||
| @RequestMapping(path = "/v1/care-contexts/link") | ||
| public class HIUFacadeLinkController { | ||
| @Autowired HIUFacadeLinkControllerInterface hiuFacadeLinkControllerInterface; | ||
|
|
||
| @PostMapping("/init") | ||
| public ResponseEntity<Object> hiuInitResponse( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the response type is object? |
||
| @RequestHeader(value = "X-AUTH-TOKEN") String xAuthToken, | ||
| @RequestBody HIUInitRequest hiuInitRequest) { | ||
| return hiuFacadeLinkControllerInterface.initiateLinkInit(hiuInitRequest, xAuthToken); | ||
| } | ||
|
|
||
| @PostMapping("/confirm") | ||
| public ResponseEntity<Object> hiuConfirmResponse( | ||
| @RequestHeader(value = "X-AUTH-TOKEN") String xAuthToken, | ||
| @RequestBody HIUConfirmRequest hiuConfirmRequest) { | ||
| return hiuFacadeLinkControllerInterface.initiateLinkConfirm(hiuConfirmRequest, xAuthToken); | ||
| } | ||
| } | ||
10 changes: 10 additions & 0 deletions
10
...ain/java/com/nha/abdm/wrapper/hiu/hrp/discovery/HIUFacadeDiscoverControllerInterface.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery; | ||
|
|
||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.requests.HIUDiscoverRequest; | ||
| import org.springframework.http.ResponseEntity; | ||
|
|
||
| public interface HIUFacadeDiscoverControllerInterface { | ||
|
Beavj marked this conversation as resolved.
|
||
|
|
||
| ResponseEntity<Object> initiateDiscover(HIUDiscoverRequest hiuDiscoverRequest, String xAuthToken); | ||
| } | ||
49 changes: 49 additions & 0 deletions
49
src/main/java/com/nha/abdm/wrapper/hiu/hrp/discovery/HIUFacadeDiscoverControllerService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery; | ||
|
|
||
| import com.nha.abdm.wrapper.common.RequestManager; | ||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.requests.HIUDiscoverRequest; | ||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.responses.DiscoverResponse; | ||
| import java.util.Objects; | ||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.http.HttpStatus; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Service | ||
| public class HIUFacadeDiscoverControllerService implements HIUFacadeDiscoverControllerInterface { | ||
| @Value("${hiuDiscoverPath}") | ||
| public String hiuDiscoverPath; | ||
|
|
||
| private final RequestManager requestManager; | ||
|
|
||
| private static final Logger log = LogManager.getLogger(HIUFacadeDiscoverControllerService.class); | ||
|
|
||
| public HIUFacadeDiscoverControllerService(RequestManager requestManager) { | ||
| this.requestManager = requestManager; | ||
| } | ||
|
|
||
| @Override | ||
| public ResponseEntity<Object> initiateDiscover( | ||
| HIUDiscoverRequest hiuDiscoverRequest, String xAuthToken) { | ||
| log.info(hiuDiscoverRequest.toString()); | ||
| if (Objects.nonNull(hiuDiscoverRequest) | ||
| && Objects.nonNull(hiuDiscoverRequest.getHip()) | ||
| && Objects.nonNull(hiuDiscoverRequest.getRequestId()) | ||
| && Objects.nonNull(xAuthToken)) { | ||
| try { | ||
| ResponseEntity<Object> response = | ||
| requestManager.fetchResponseForPHR(hiuDiscoverPath, hiuDiscoverRequest, xAuthToken, ""); | ||
|
|
||
| log.info(response.getBody().toString()); | ||
| return response; | ||
|
|
||
| } catch (Exception e) { | ||
| throw new RuntimeException("unable to make post request from discover " + e); | ||
| } | ||
| } | ||
| return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new DiscoverResponse()); | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/nha/abdm/wrapper/hiu/hrp/discovery/requests/HIUDiscoverRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery.requests; | ||
|
|
||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.requests.helpers.HIPId; | ||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.requests.helpers.HIUPatientUnverifiedIdentifiers; | ||
| import java.util.List; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class HIUDiscoverRequest { | ||
| public HIPId hip; | ||
| public String requestId; | ||
| public List<HIUPatientUnverifiedIdentifiers> unverifiedIdentifiers; | ||
| } |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/nha/abdm/wrapper/hiu/hrp/discovery/requests/helpers/HIPId.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery.requests.helpers; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class HIPId { | ||
| public String id; | ||
| } |
16 changes: 16 additions & 0 deletions
16
.../nha/abdm/wrapper/hiu/hrp/discovery/requests/helpers/HIUPatientUnverifiedIdentifiers.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery.requests.helpers; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class HIUPatientUnverifiedIdentifiers { | ||
| public String type; | ||
| public String value; | ||
| } |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/nha/abdm/wrapper/hiu/hrp/discovery/responses/DiscoverResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery.responses; | ||
|
|
||
| import com.nha.abdm.wrapper.common.responses.ErrorResponse; | ||
| import com.nha.abdm.wrapper.hiu.hrp.discovery.responses.helpers.HIUPatient; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class DiscoverResponse { | ||
| private static final long serialVersionUID = 165269402517398406L; | ||
| public String transactionId; | ||
| public HIUPatient patient; | ||
| public String createdAt; | ||
| public ErrorResponse error; | ||
| } |
6 changes: 6 additions & 0 deletions
6
...ain/java/com/nha/abdm/wrapper/hiu/hrp/discovery/responses/helpers/CareContextRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery.responses.helpers; | ||
|
|
||
| public class CareContextRequest { | ||
| private String referenceNumber; | ||
| } |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/nha/abdm/wrapper/hiu/hrp/discovery/responses/helpers/HIUPatient.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.discovery.responses.helpers; | ||
|
|
||
| import com.nha.abdm.wrapper.common.models.CareContext; | ||
| import java.util.List; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class HIUPatient { | ||
| public String referenceNumber; | ||
| public String display; | ||
| public List<CareContext> careContexts; | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/nha/abdm/wrapper/hiu/hrp/link/HIUFacadeLinkControllerInterface.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.link; | ||
|
|
||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.HIUConfirmRequest; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.HIUInitRequest; | ||
| import org.springframework.http.ResponseEntity; | ||
|
|
||
| public interface HIUFacadeLinkControllerInterface { | ||
| ResponseEntity<Object> initiateLinkInit(HIUInitRequest hiuInitRequest, String xAuthToken); | ||
|
|
||
| ResponseEntity<Object> initiateLinkConfirm( | ||
| HIUConfirmRequest hiuConfirmRequest, String xAuthToken); | ||
| } |
77 changes: 77 additions & 0 deletions
77
src/main/java/com/nha/abdm/wrapper/hiu/hrp/link/HIUFacadeLinkControllerService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.link; | ||
|
|
||
| import com.nha.abdm.wrapper.common.RequestManager; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.HIUConfirmRequest; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.HIUInitRequest; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.responses.ConfirmResponse; | ||
| import com.nha.abdm.wrapper.hiu.hrp.link.responses.InitResponse; | ||
| import java.util.Objects; | ||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.http.HttpStatus; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Service | ||
| public class HIUFacadeLinkControllerService implements HIUFacadeLinkControllerInterface { | ||
| private static final Logger log = LogManager.getLogger(HIUFacadeLinkControllerInterface.class); | ||
|
|
||
| private final RequestManager requestManager; | ||
|
|
||
| @Value("${hiuInitPath}") | ||
| public String hiuInitPath; | ||
|
|
||
| @Value("${hiuLinkConfirmPath}") | ||
| public String hiuLinkConfirmPath; | ||
|
|
||
| public HIUFacadeLinkControllerService(RequestManager requestManager) { | ||
| this.requestManager = requestManager; | ||
| } | ||
|
|
||
| @Override | ||
| public ResponseEntity<Object> initiateLinkInit(HIUInitRequest hiuInitRequest, String xAuthToken) { | ||
| log.info(hiuInitRequest.toString()); | ||
|
|
||
| if (Objects.nonNull(hiuInitRequest) | ||
| && Objects.nonNull(hiuInitRequest.getRequestId()) | ||
| && Objects.nonNull(hiuInitRequest.getTransactionId()) | ||
| && Objects.nonNull(hiuInitRequest.getPatient()) | ||
| && Objects.nonNull(xAuthToken)) { | ||
| try { | ||
| ResponseEntity<Object> response = | ||
| requestManager.fetchResponseForPHR(hiuInitPath, hiuInitRequest, xAuthToken, ""); | ||
| return response; | ||
|
|
||
| } catch (Exception e) { | ||
| throw new RuntimeException("unable to make post request from linkint " + e); | ||
| } | ||
| } | ||
| return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new InitResponse()); | ||
| } | ||
|
|
||
| @Override | ||
| public ResponseEntity<Object> initiateLinkConfirm( | ||
| HIUConfirmRequest hiuConfirmRequest, String xAuthToken) { | ||
| log.info(hiuConfirmRequest.toString()); | ||
| if (Objects.nonNull(hiuConfirmRequest) | ||
| && Objects.nonNull(hiuConfirmRequest.getReferenceNumber()) | ||
| && Objects.nonNull(hiuConfirmRequest.getToken()) | ||
| && Objects.nonNull(xAuthToken)) { | ||
| try { | ||
| ResponseEntity<Object> response = | ||
| requestManager.fetchResponseForPHR( | ||
| hiuLinkConfirmPath, | ||
| hiuConfirmRequest, | ||
| xAuthToken, | ||
| "/" + hiuConfirmRequest.getReferenceNumber()); | ||
| return response; | ||
|
|
||
| } catch (Exception e) { | ||
| throw new RuntimeException("unable to make post request from linkconfirm " + e); | ||
| } | ||
| } | ||
| return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ConfirmResponse()); | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/nha/abdm/wrapper/hiu/hrp/link/requests/HIUConfirmRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.link.requests; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class HIUConfirmRequest { | ||
| public String token; | ||
| public String referenceNumber; | ||
| } |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/nha/abdm/wrapper/hiu/hrp/link/requests/HIUInitRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* (C) 2024 */ | ||
| package com.nha.abdm.wrapper.hiu.hrp.link.requests; | ||
|
|
||
| import com.nha.abdm.wrapper.hiu.hrp.link.requests.helpers.PatientWithReferenceNumber; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class HIUInitRequest { | ||
| public String requestId; | ||
| public String transactionId; | ||
| public PatientWithReferenceNumber patient; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it mean that we are sending requests to PHR? if not, then lets rename this accordingly